[ https://issues.apache.org/jira/browse/KAFKA-8453?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16885289#comment-16885289 ]
ASF GitHub Bot commented on KAFKA-8453: --------------------------------------- dongjinleekr commented on pull request #7089: KAFKA-8453: AdminClient describeTopic should handle partition level errors URL: https://github.com/apache/kafka/pull/7089 Here is the draft fix. The approach is simple: 1. Add a new method, `MetadataResponse#partitionErrors`, which returns a map from topic to the set of its partition errors. (It follows how `MetadataResponse#topicMetadata` does.) 2. `Call#handleResponse` in `KafkaAdminClient#describeTopics` now uses both of topic level error map and partition level error map; if there is `ListenerNotFound` error in partition level error map, it calls `KafkaFuture#completeExceptionally`. However, since it now throws a new Exception, it brokes following tests which are related to the leader election. - `kafka.server.DynamicBrokerReconfigurationTest.testUncleanLeaderElectionEnable` - `kafka.api.AdminClientIntegrationTest.testElectUncleanLeadersAndNoop` - `kafka.api.AdminClientIntegrationTest.testElectUncleanLeadersForManyPartitions` - `kafka.api.AdminClientIntegrationTest.testElectUncleanLeadersForAllPartitions` - `kafka.api.AdminClientIntegrationTest.testElectUncleanLeadersForOnePartition` - `kafka.api.AdminClientIntegrationTest.testElectUncleanLeadersWhenNoLiveBrokers` - `kafka.api.SaslSslAdminClientIntegrationTest.testElectUncleanLeadersAndNoop` - `kafka.api.SaslSslAdminClientIntegrationTest.testElectUncleanLeadersForManyPartitions` - `kafka.api.SaslSslAdminClientIntegrationTest.testElectUncleanLeadersForAllPartitions` - `kafka.api.SaslSslAdminClientIntegrationTest.testElectUncleanLeadersForOnePartition` - `kafka.api.SaslSslAdminClientIntegrationTest.testElectUncleanLeadersWhenNoLiveBrokers` - `kafka.admin.TopicCommandWithAdminClientTest.testDescribeUnavailablePartitions` - `kafka.admin.TopicCommandWithAdminClientTest.testDescribeUnderMinIsrPartitionsMixed` Which approach would be appropriate to fix the problem above? Do you have something in mind? cc/ @hachikuji ### Committer Checklist (excluded from commit message) - [ ] Verify design and implementation - [ ] Verify test coverage and CI build status - [ ] Verify documentation (including upgrade notes) ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > AdminClient describeTopic should handle partition level errors > -------------------------------------------------------------- > > Key: KAFKA-8453 > URL: https://issues.apache.org/jira/browse/KAFKA-8453 > Project: Kafka > Issue Type: Bug > Reporter: Jason Gustafson > Priority: Major > > The Metadata response may contain the following partition-level error codes: > LEADER_NOT_AVAILABLE, REPLICA_NOT_AVAILABLE, and LISTENER_NOT_FOUND. The > AdminClient at the moment does not appear to be checking these error codes. > This seems mostly harmless in the case of LEADER_NOT_AVAILABLE and > REPLICA_NOT_AVAILABLE, but potentially we should raise an error in the case > of LISTENER_NOT_FOUND since the result would otherwise be misleading. -- This message was sent by Atlassian JIRA (v7.6.14#76016)