AndrewJSchofield commented on code in PR #24115:
URL: https://github.com/apache/kafka/pull/24115#discussion_r4628973156
##########
clients/src/main/java/org/apache/kafka/clients/admin/internals/AdminMetadataManager.java:
##########
@@ -84,6 +87,11 @@ public class AdminMetadataManager {
*/
private long lastMetadataFetchAttemptMs = 0;
+ /**
+ * The number of successive metadata responses that did not change the
cluster nodes.
+ */
+ private final AtomicLong equivalentResponseCount = new AtomicLong(0);
Review Comment:
This could probably be a plain `long`.
##########
clients/src/main/java/org/apache/kafka/clients/admin/internals/AdminMetadataManager.java:
##########
@@ -354,6 +375,14 @@ public void update(Cluster cluster, long now) {
bootstrapCluster = cluster;
} else {
log.debug("Updating cluster metadata to {}", cluster);
+ // Only the nodes are compared, since brokers report a random
broker as the controller.
Review Comment:
When bootstrapping, it is true that the brokers report a random controller.
However, when talking directly to a specific controller quorum, I don't think
it's true.
If `!usingBootstrapControllers`, I think you can compare
`cluster.controller()` with `this.cluster.controller()`.
--
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]