cmccabe commented on code in PR #14028:
URL: https://github.com/apache/kafka/pull/14028#discussion_r1272782778


##########
metadata/src/main/java/org/apache/kafka/controller/metrics/ControllerMetadataMetrics.java:
##########
@@ -117,6 +120,15 @@ public Integer value() {
                 return (int) zkMigrationState();
             }
         }));
+
+        if (zkMigrationEnabled) {

Review Comment:
   This is the wrong place to put this -- it belongs in 
`ControllerMetadataMetrics` since it can be calculated directly from the 
`MetadataImage`.
   
   We should also do the same for `ZkMigrationState`, it should not be in 
`ControllerMetadataMetrics` since it comes from the image.
   
   Separately from that, I wonder why we need to have this "if" statement. 
Can't we just unconditionally report this (as 0 when there no migrating 
brokers).



-- 
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