CalvinConfluent commented on code in PR #14593:
URL: https://github.com/apache/kafka/pull/14593#discussion_r1372384881


##########
metadata/src/main/java/org/apache/kafka/controller/PartitionChangeBuilder.java:
##########
@@ -361,11 +410,16 @@ public Optional<ApiMessageAndVersion> build() {
 
         maybeUpdateRecordElr(record);
 
-        if (record.isr() == null && !targetIsr.isEmpty() && 
!targetIsr.equals(Replicas.toList(partition.isr))) {
+        // If ELR is enabled, the ISR is allowed to be empty.
+        if (record.isr() == null && (!targetIsr.isEmpty() || 
eligibleLeaderReplicasEnabled) && 
!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.
+            if (targetIsr.isEmpty()) {
+                log.info("A partition will have an empty ISR. " + this);

Review Comment:
   Good point. log will be flushed with this message during a shutdown.



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