CalvinConfluent commented on code in PR #14312: URL: https://github.com/apache/kafka/pull/14312#discussion_r1357255199
########## metadata/src/main/java/org/apache/kafka/controller/PartitionChangeBuilder.java: ########## @@ -328,13 +353,37 @@ public Optional<ApiMessageAndVersion> build() { completeReassignmentIfNeeded(); + if (PartitionChangeBuilder.this.eligibleLeaderReplicasEnabled) { + 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); + // During the leader election, it can set the record isr if an unclean leader election happens. Review Comment: This PR mostly just manages the ELR fields, no election behavior changes. I will try to make the leader election in separate paths with/without ELR in the following leader election PR. -- 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