artemlivshits commented on code in PR #14706:
URL: https://github.com/apache/kafka/pull/14706#discussion_r1401454282


##########
metadata/src/main/java/org/apache/kafka/controller/PartitionChangeBuilder.java:
##########
@@ -528,6 +536,10 @@ private void maybePopulateTargetElr() {
             .collect(Collectors.toList());
     }
 
+    static boolean recordHasLeader(PartitionChangeRecord record) {

Review Comment:
   Do we use this now?



##########
metadata/src/main/java/org/apache/kafka/controller/PartitionChangeBuilder.java:
##########
@@ -466,6 +466,10 @@ private void 
maybeUpdateLastKnownLeader(PartitionChangeRecord record) {
             partition.lastKnownElr[0] != partition.leader)) {
             // Only update the last known leader when the first time the 
partition becomes leaderless.
             record.setLastKnownELR(Arrays.asList(partition.leader));
+        } else if ((record.leader() > 0 || (partition.leader != NO_LEADER && 
record.leader() != NO_LEADER))

Review Comment:
   0 is a valid leader, so probably should use `record.leader() >= 0`.



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