chia7712 commented on code in PR #20068:
URL: https://github.com/apache/kafka/pull/20068#discussion_r2283536439
##########
core/src/test/scala/integration/kafka/api/PlaintextAdminIntegrationTest.scala:
##########
@@ -3034,6 +3034,21 @@ class PlaintextAdminIntegrationTest extends
BaseAdminIntegrationTest {
}
}
+ /**
+ * Waits until the metadata for the given partition has fully propagated and
become consistent across all brokers.
+ *
+ * @param partition The partition whose leader metadata should be verified
across all brokers.
+ */
+ def waitForBrokerMetadataPropagation(partition: TopicPartition): Unit = {
+ while (true) {
+ val headBrokerLeaderId =
brokers.head.metadataCache.getPartitionLeaderEndpoint(partition.topic,
partition.partition(), listenerName).get.id()
Review Comment:
sorry that the code has a issue, which can pass even though only one broker
get latest metadata. Could you please fix it by adding extra check for "all"
brokers have non-empty partition leader?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]