Skip to content

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

Open
m1a2st wants to merge 5 commits intoapache:trunkfrom
m1a2st:KAFKA-20506
Open

KAFKA-20506 kafka-configs.sh can't delete the config from a offline broker when using bootstrap controller#22104
m1a2st wants to merge 5 commits intoapache:trunkfrom
m1a2st:KAFKA-20506

Conversation

@m1a2st
Copy link
Copy Markdown
Collaborator

@m1a2st m1a2st commented Apr 20, 2026

Ref #22070 (comment)

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

@github-actions github-actions Bot added triage PRs from the community tools labels Apr 20, 2026
@chia7712 chia7712 changed the title KAFKA-20506 kafka-configs.sh can't delete a nonexistent config from a offline broker when using bootstrap controller KAFKA-20506 kafka-configs.sh can't delete the config from a offline broker when using bootstrap controller Apr 20, 2026
throw ee;
}
} else if (BROKER_LOGGER_CONFIG_TYPE.equals(entityType)) {
List<String> validLoggers = getResourceConfig(adminClient, entityType, entityName, true, false).stream().map(ConfigEntry::name).toList();
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.

It looks like an existing bug, as the synonyms are not actually being used. Therefore, it should pass true instead of false.

}

private static void alterResourceConfig(Admin adminClient, String entityTypeHead, String entityNameHead, List<String> configsToBeDeleted, Map<String, ConfigEntry> configsToBeAdded, ConfigResource.Type resourceType) throws ExecutionException, InterruptedException, TimeoutException {
Map<String, ConfigEntry> oldConfig = getResourceConfig(adminClient, entityTypeHead, entityNameHead, false, false)
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.

please add this changes to upgrade.md

Comment thread docs/getting-started/upgrade.md Outdated

### Notable changes in 4.4.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.

Since this fix will be backported to the 4.3 branch, this note can be deferred to the PR targeting 4.3.

@m1a2st
Copy link
Copy Markdown
Collaborator Author

m1a2st commented Apr 22, 2026

For 4.3 branch: #22113

@github-actions github-actions Bot removed the triage PRs from the community label Apr 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants