hachikuji commented on pull request #11681:
URL: https://github.com/apache/kafka/pull/11681#issuecomment-1042520005


   >  it doesn't work to put the admin client creating after 
cluster.waitForReadyBrokers(), because the waitForReadyBrokers only wait for 
all brokers registered and unfenced (ref: 
[here](https://github.com/apache/kafka/blob/trunk/core/src/test/java/kafka/testkit/KafkaClusterTestKit.java#L375)),
 but the metadata cache in broker might have not updated the cluster metadata. 
I think we need to explicitly wait for all brokers up via describeCluster and 
then create adminClient for testing.
   
   Hmm, I wonder if this is right. I checked the `QuorumController` logic and 
unfencing implies that the broker has caught up to the current end of the log. 
At least it implies that the offset reported in the heartbeat request is up to 
date. From what I can tell, there might still be a race between the time that 
this offset gets updated in `BrokerMetadataListener` and the time that the 
latest entries have been published to `BrokerMetadataPublisher`. Is that delay 
enough to explain the issue?


-- 
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-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to