cmccabe commented on code in PR #19586: URL: https://github.com/apache/kafka/pull/19586#discussion_r2076270361
########## metadata/src/main/java/org/apache/kafka/controller/metrics/ControllerMetricsChanges.java: ########## @@ -74,21 +80,38 @@ public int partitionsWithoutPreferredLeaderChange() { return partitionsWithoutPreferredLeaderChange; } - void handleBrokerChange(BrokerRegistration prev, BrokerRegistration next) { + void handleBrokerChange(BrokerRegistration prev, BrokerRegistration next, ControllerMetadataMetrics metrics) { boolean wasFenced = false; boolean wasActive = false; + boolean wasInControlledShutdown = false; if (prev != null) { wasFenced = prev.fenced(); wasActive = !prev.fenced(); + wasInControlledShutdown = prev.inControlledShutdown(); + } else { + metrics.addBrokerRegistrationStateMetric(next.id()); } boolean isFenced = false; boolean isActive = false; + boolean isInControlledShutdown = false; if (next != null) { isFenced = next.fenced(); isActive = !next.fenced(); + isInControlledShutdown = next.inControlledShutdown(); + if (isFenced) { Review Comment: we should be able to just pass the `BrokerRegistration` object to `setBrokerRegistrationState`, right? -- 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