You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Rancho-7 (via GitHub)" <gi...@apache.org> on 2026/04/22 03:24:37 UTC
[PR] MINOR: Optimize `describeConfigs` queries and address cleanups for `ConfigCommand` [kafka]
Rancho-7 opened a new pull request, #22114:
URL: https://github.com/apache/kafka/pull/22114
see discussion : https://github.com/apache/kafka/pull/22013#pullrequestreview-4133302711
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] MINOR: Optimize `describeConfigs` queries and address cleanups for `ConfigCommand` [kafka]
Posted by "Rancho-7 (via GitHub)" <gi...@apache.org>.
Rancho-7 commented on code in PR #22114:
URL: https://github.com/apache/kafka/pull/22114#discussion_r3192800221
##########
tools/src/main/java/org/apache/kafka/tools/ConfigCommand.java:
##########
@@ -608,12 +633,11 @@ private static List<ConfigEntry> getResourceConfig(Admin adminClient, String ent
configResourceType = ConfigResource.Type.TOPIC;
dynamicConfigSource = Optional.of(ConfigEntry.ConfigSource.DYNAMIC_TOPIC_CONFIG);
} else if (BROKER_TYPE.equals(entityType)) {
+ configResourceType = ConfigResource.Type.BROKER;
if (BROKER_DEFAULT_ENTITY_NAME.equals(entityName)) {
- configResourceType = ConfigResource.Type.BROKER;
dynamicConfigSource = Optional.of(ConfigEntry.ConfigSource.DYNAMIC_DEFAULT_BROKER_CONFIG);
} else {
validateBrokerId(entityName, entityType);
- configResourceType = ConfigResource.Type.BROKER;
dynamicConfigSource = Optional.of(ConfigEntry.ConfigSource.DYNAMIC_BROKER_CONFIG);
}
} else if (BROKER_LOGGER_CONFIG_TYPE.equals(entityType)) {
Review Comment:
Agreed. Setting this filer explicitly is indeed more consistent. Thanks for the suggestion.
##########
tools/src/test/java/org/apache/kafka/tools/ConfigCommandTest.java:
##########
@@ -944,9 +947,17 @@ public void shouldRaiseInvalidConfigurationExceptionWhenAddingInvalidBrokerLogge
Node node = new Node(1, "localhost", 9092);
// verifyAlterBrokerLoggerConfig tries to alter kafka.log.LogCleaner, kafka.server.ReplicaManager and kafka.server.KafkaApi
// yet, we make it so DescribeConfigs returns only one logger, implying that kafka.server.ReplicaManager and kafka.log.LogCleaner are invalid
- assertThrows(InvalidConfigurationException.class, () -> verifyAlterBrokerLoggerConfig(node, "1", "1", List.of(
- new ConfigEntry("kafka.server.KafkaApi", "INFO")
- )));
+ InvalidConfigurationException exception = assertThrows(
+ InvalidConfigurationException.class,
+ () -> verifyAlterBrokerLoggerConfig(node, "1", "1", List.of(
+ newBrokerLoggerConfigEntry("kafka.server.KafkaApi", "INFO")
+ ))
+ );
+ assertEquals(
Review Comment:
Tighten the assertion to verify the exact invalid loggers, otherwise the test could pass even if the returned `KafkaApi logger` was filtered out incorrectly.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] MINOR: Optimize `describeConfigs` queries and address cleanups for `ConfigCommand` [kafka]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #22114:
URL: https://github.com/apache/kafka/pull/22114#issuecomment-4340760753
A label of 'needs-attention' was automatically added to this PR in order to raise the
attention of the committers. Once this issue has been triaged, the `triage` label
should be removed to prevent this automation from happening again.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] MINOR: Optimize `describeConfigs` queries and address cleanups for `ConfigCommand` [kafka]
Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 commented on PR #22114:
URL: https://github.com/apache/kafka/pull/22114#issuecomment-4355067124
@Rancho-7 would you mind fixing the conflicts?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] MINOR: Optimize `describeConfigs` queries and address cleanups for `ConfigCommand` [kafka]
Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 commented on code in PR #22114:
URL: https://github.com/apache/kafka/pull/22114#discussion_r3174648660
##########
tools/src/main/java/org/apache/kafka/tools/ConfigCommand.java:
##########
@@ -608,12 +633,11 @@ private static List<ConfigEntry> getResourceConfig(Admin adminClient, String ent
configResourceType = ConfigResource.Type.TOPIC;
dynamicConfigSource = Optional.of(ConfigEntry.ConfigSource.DYNAMIC_TOPIC_CONFIG);
} else if (BROKER_TYPE.equals(entityType)) {
+ configResourceType = ConfigResource.Type.BROKER;
if (BROKER_DEFAULT_ENTITY_NAME.equals(entityName)) {
- configResourceType = ConfigResource.Type.BROKER;
dynamicConfigSource = Optional.of(ConfigEntry.ConfigSource.DYNAMIC_DEFAULT_BROKER_CONFIG);
} else {
validateBrokerId(entityName, entityType);
- configResourceType = ConfigResource.Type.BROKER;
dynamicConfigSource = Optional.of(ConfigEntry.ConfigSource.DYNAMIC_BROKER_CONFIG);
}
} else if (BROKER_LOGGER_CONFIG_TYPE.equals(entityType)) {
Review Comment:
IIRC, logger-related configs always use the DYNAMIC_BROKER_LOGGER_CONFIG type, so it seems we don't need to set the filter to empty
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] MINOR: Optimize `describeConfigs` queries and address cleanups for `ConfigCommand` [kafka]
Posted by "Rancho-7 (via GitHub)" <gi...@apache.org>.
Rancho-7 commented on code in PR #22114:
URL: https://github.com/apache/kafka/pull/22114#discussion_r3192800221
##########
tools/src/main/java/org/apache/kafka/tools/ConfigCommand.java:
##########
@@ -608,12 +633,11 @@ private static List<ConfigEntry> getResourceConfig(Admin adminClient, String ent
configResourceType = ConfigResource.Type.TOPIC;
dynamicConfigSource = Optional.of(ConfigEntry.ConfigSource.DYNAMIC_TOPIC_CONFIG);
} else if (BROKER_TYPE.equals(entityType)) {
+ configResourceType = ConfigResource.Type.BROKER;
if (BROKER_DEFAULT_ENTITY_NAME.equals(entityName)) {
- configResourceType = ConfigResource.Type.BROKER;
dynamicConfigSource = Optional.of(ConfigEntry.ConfigSource.DYNAMIC_DEFAULT_BROKER_CONFIG);
} else {
validateBrokerId(entityName, entityType);
- configResourceType = ConfigResource.Type.BROKER;
dynamicConfigSource = Optional.of(ConfigEntry.ConfigSource.DYNAMIC_BROKER_CONFIG);
}
} else if (BROKER_LOGGER_CONFIG_TYPE.equals(entityType)) {
Review Comment:
Agreed. Setting this filer explicitly is indeed more consistent. Thanks for the suggestion.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] MINOR: Optimize `describeConfigs` queries and address cleanups for `ConfigCommand` [kafka]
Posted by "Rancho-7 (via GitHub)" <gi...@apache.org>.
Rancho-7 commented on code in PR #22114:
URL: https://github.com/apache/kafka/pull/22114#discussion_r3209272005
##########
tools/src/main/java/org/apache/kafka/tools/ConfigCommand.java:
##########
@@ -597,7 +619,10 @@ static void validateBrokerId(String entityName, String entityType) {
}
}
- private static List<ConfigEntry> getResourceConfig(Admin adminClient, String entityType, String entityName, boolean includeSynonyms, boolean describeAll) throws ExecutionException, InterruptedException, TimeoutException {
+ private record DescribeConfigContext(ConfigResource configResource, Optional<ConfigEntry.ConfigSource> dynamicConfigSource) {
Review Comment:
You're right, updated it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] MINOR: Optimize `describeConfigs` queries and address cleanups for `ConfigCommand` [kafka]
Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 merged PR #22114:
URL: https://github.com/apache/kafka/pull/22114
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] MINOR: Optimize `describeConfigs` queries and address cleanups for `ConfigCommand` [kafka]
Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 commented on code in PR #22114:
URL: https://github.com/apache/kafka/pull/22114#discussion_r3205884052
##########
tools/src/main/java/org/apache/kafka/tools/ConfigCommand.java:
##########
@@ -597,7 +619,10 @@ static void validateBrokerId(String entityName, String entityType) {
}
}
- private static List<ConfigEntry> getResourceConfig(Admin adminClient, String entityType, String entityName, boolean includeSynonyms, boolean describeAll) throws ExecutionException, InterruptedException, TimeoutException {
+ private record DescribeConfigContext(ConfigResource configResource, Optional<ConfigEntry.ConfigSource> dynamicConfigSource) {
Review Comment:
we never use `Optional.empty` to define `dynamicConfigSource`, right?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] MINOR: Optimize `describeConfigs` queries and address cleanups for `ConfigCommand` [kafka]
Posted by "Rancho-7 (via GitHub)" <gi...@apache.org>.
Rancho-7 commented on PR #22114:
URL: https://github.com/apache/kafka/pull/22114#issuecomment-4359107030
> @Rancho-7 would you mind fixing the conflicts?
fixed it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org