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


##########
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);

Review Comment:
   Not really, the main reason the change turned out this way was because I 
couldn't figure out what to do about the default case that throws and doesn't 
transition state.
   
   I think I can make the suggestion work by reverting the metric and state in 
the default case.



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