CalvinConfluent commented on code in PR #14312: URL: https://github.com/apache/kafka/pull/14312#discussion_r1349612437
########## metadata/src/main/java/org/apache/kafka/controller/PartitionChangeBuilder.java: ########## @@ -328,13 +349,38 @@ public Optional<ApiMessageAndVersion> build() { completeReassignmentIfNeeded(); + boolean isElrEnabled = metadataVersion.isElrSupported(); + if (isElrEnabled) { + populateTargetElr(); + } + tryElection(record); triggerLeaderEpochBumpIfNeeded(record); - if (record.isr() == null && !targetIsr.isEmpty() && !targetIsr.equals(Replicas.toList(partition.isr))) { - // Set the new ISR if it is different from the current ISR and unclean leader election didn't already set it. - record.setIsr(targetIsr); + boolean isCleanLeaderElection = record.isr() == null; Review Comment: Done. -- 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