KAFKA-19028: Expose deleted configs to AlterConfigPolicy without changing configs() - #23545
Open
arnabnandy7 wants to merge 1 commit into
Open
arnabnandy7 wants to merge 1 commit into
arnabnandy7 wants to merge 1 commit into
Conversation
Contributor
Author
|
@chia7712 please review |
arnabnandy7
force-pushed
the
fix/alterConfigPolicyCompatibility
branch
from
September 21, 2026 17:51
8e571e2 to
80bf189
Compare
Signed-off-by: Arnab Nandy <arnab_nandy7@yahoo.com>
arnabnandy7
force-pushed
the
fix/alterConfigPolicyCompatibility
branch
from
September 21, 2026 17:52
80bf189 to
63c348f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.