squah-confluent commented on code in PR #18499:
URL: https://github.com/apache/kafka/pull/18499#discussion_r1918419791


##########
coordinator-common/src/main/java/org/apache/kafka/coordinator/common/runtime/CoordinatorRuntime.java:
##########
@@ -670,23 +671,30 @@ private void transitionTo(
                     highWatermarklistener = new HighWatermarkListener();
                     partitionWriter.registerListener(tp, 
highWatermarklistener);
                     coordinator.onLoaded(metadataImage);
+                    // Update partition metrics only after the coordinator 
context is fully loaded.
+                    runtimeMetrics.recordPartitionStateChange(oldState, state);
                     break;
 
                 case FAILED:
                     state = CoordinatorState.FAILED;
+                    // Update partition metrics before unload, since the 
coordinator context is no
+                    // longer usable.

Review Comment:
   Right, this is gone now after I reworked the metrics fix.



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