Skip to content

KAFKA-20506 kafka-configs.sh can't delete the config from a offline broker when using bootstrap controller#22113

Merged
chia7712 merged 3 commits intoapache:4.3from
m1a2st:KAFKA-20506-4.3
Apr 23, 2026
Merged

KAFKA-20506 kafka-configs.sh can't delete the config from a offline broker when using bootstrap controller#22113
chia7712 merged 3 commits intoapache:4.3from
m1a2st:KAFKA-20506-4.3

Conversation

@m1a2st
Copy link
Copy Markdown
Collaborator

@m1a2st m1a2st commented Apr 22, 2026

Remove the pre-flight DescribeConfigs existence check in
alterResourceConfig() since deleting a non-existent config is
idempotent, and the check causes a timeout when the target broker is
offline.

Reviewers: Chia-Ping Tsai chia7712@gmail.com

@m1a2st m1a2st changed the title to 4.3 branch KAFKA-20506 kafka-configs.sh can't delete the config from a offline broker when using bootstrap controller Apr 22, 2026
case BrokerLoggerConfigType =>
val validLoggers = getResourceConfig(adminClient, entityTypeHead, entityNameHead, includeSynonyms = true, describeAll = false).map(_.name)
val validLoggers = getResourceConfig(adminClient, entityTypeHead, entityNameHead, includeSynonyms = false, describeAll = false).map(_.name)
// fail the command if any of the configured broker loggers do not exist
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we align the deletion behavior? Making it idempotent seems like the right way to go.

Copy link
Copy Markdown
Collaborator Author

@m1a2st m1a2st Apr 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For BrokerLoggerConfigType, I removed the client-side pre-flight check for deletion so it's aligned with the other config types. However, the server-side ConfigAdminManager still validates that the logger exists when processing incrementalAlterConfigs.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is a good point. Would you mind opening a ticket to discuss it separately? I prefer to have consistent and idempotent deletion, but it may be out of scope of this PR.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


### Notable changes in 4.3.0

* `kafka-configs.sh --alter --delete-config` no longer requires the specified config keys to exist on the target resource. Previously, attempting to delete a non-existent config key raised an `InvalidConfigurationException`. The deletion is now a no-op when the key does not exist, which allows managing configs for offline brokers via `--bootstrap-controller`. For further details, please refer to [KAFKA-20506](https://issues.apache.org/jira/browse/KAFKA-20506).
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please port this change to the trunk version as well?

@chia7712 chia7712 merged commit 3c688ff into apache:4.3 Apr 23, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants