CalvinConfluent commented on code in PR #14706: URL: https://github.com/apache/kafka/pull/14706#discussion_r1400036881
########## 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 ((recordHasLeader(record) || partition.leader != NO_LEADER) Review Comment: Good catch! To improve the readability, revise to the following. `record.leader() > 0 || (partition.leader != NO_LEADER && record.leader() != NO_LEADER)` `(Will have a new leader) || (will not become leaderless)` -- 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