cmccabe commented on code in PR #19590: URL: https://github.com/apache/kafka/pull/19590#discussion_r2069562903
########## metadata/src/main/java/org/apache/kafka/controller/metrics/ControllerMetricsChanges.java: ########## @@ -105,10 +114,25 @@ void handleTopicChange(TopicImage prev, TopicDelta topicDelta) { } else { for (Entry<Integer, PartitionRegistration> entry : topicDelta.partitionChanges().entrySet()) { int partitionId = entry.getKey(); + PartitionRegistration prevPartition = prev.partitions().get(partitionId); PartitionRegistration nextPartition = entry.getValue(); - handlePartitionChange(prev.partitions().get(partitionId), nextPartition); + handlePartitionChange(prevPartition, nextPartition); + + // Though we don't know if there is an unclean leader election/ELR election happened in the very beginning Review Comment: we should know if the unclean election happened at the beginning of the delta, right? since we can compare what's changing with the previous image (accessible from the delta) -- 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