Skip to content

KAFKA-19028: Expose deleted configs to AlterConfigPolicy without changing configs() - #23545

Open
arnabnandy7 wants to merge 1 commit into
apache:trunkfrom
arnabnandy7:fix/alterConfigPolicyCompatibility
Open

arnabnandy7 wants to merge 1 commit into
apache:trunkfrom
arnabnandy7:fix/alterConfigPolicyCompatibility

Conversation

@arnabnandy7

@arnabnandy7 arnabnandy7 commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

An incremental DELETE of an unset topic configuration generates no ConfigRecord, so AlterConfigPolicy.RequestMetadata.configs() omits the key. A broker DELETE generates a record and appears in that map with a null value. This makes an explicit DELETE difficult for a policy to identify consistently across resource types.

This change preserves the existing configs() behavior and adds RequestMetadata.deletedConfigs(), which contains the names of all explicitly requested incremental DELETEs, including no-op topic deletions. It also adds configsWithoutNullValues() for policies that need the non-null entries from configs().

The existing public RequestMetadata constructor remains available. Legacy AlterConfigs requests report an empty deletedConfigs() set.

Compatibility

The map returned by configs() is unchanged, preserving the KRaft behavior that the ZooKeeper compatibility flag from KIP-1252 was designed to match. Policies can opt into the new deletion information without changing existing validation logic.

This adds methods to a public policy API; maintainer guidance on whether a KIP is required is welcome.

Testing

Updated controller unit coverage to assert the policy arguments for an unset topic DELETE, a stored topic DELETE, and an unset broker DELETE. Added API unit coverage for the new accessors and constructor, and verified that the legacy path reports no explicit deletions.

@arnabnandy7

Copy link
Copy Markdown
Contributor Author

@chia7712 please review

cc @edoardocomar

@arnabnandy7 arnabnandy7 changed the title KAFKA-19028: Preserve alter config policy compatibility KAFKA-19028: Expose deleted configs to AlterConfigPolicy without changing configs() Sep 21, 2026
@arnabnandy7
arnabnandy7 force-pushed the fix/alterConfigPolicyCompatibility branch from 8e571e2 to 80bf189 Compare September 21, 2026 17:51
Signed-off-by: Arnab Nandy <arnab_nandy7@yahoo.com>
@arnabnandy7
arnabnandy7 force-pushed the fix/alterConfigPolicyCompatibility branch from 80bf189 to 63c348f Compare September 21, 2026 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clients kraft small Small PRs triage PRs from the community

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant