mmatloka commented on code in PR #21134:
URL: https://github.com/apache/kafka/pull/21134#discussion_r2618614627


##########
metadata/src/main/java/org/apache/kafka/controller/metrics/ControllerMetricsChanges.java:
##########
@@ -138,7 +142,9 @@ void handlePartitionChange(PartitionRegistration prev, 
PartitionRegistration nex
             isWithoutPreferredLeader = !next.hasPreferredLeader();
             // take current all replicas as ISR if prev is null (new created 
partition), so we won't treat it as unclean election.
             int[] prevIsr = prev != null ? prev.isr : next.replicas;
-            if (!PartitionRegistration.electionWasClean(next.leader, prevIsr)) 
{
+            // check if at the same step the partition we are adding to ISR is 
becoming the leader, don't treat that as unclean election.
+            int[] nextAddingReplicas = next.addingReplicas;

Review Comment:
   Could someone doublecheck my thinking? AddingReplicas will appear in prev or 
in next?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to