dajac commented on code in PR #13408:
URL: https://github.com/apache/kafka/pull/13408#discussion_r1148431864


##########
metadata/src/main/java/org/apache/kafka/controller/ReplicationControlManager.java:
##########
@@ -1156,9 +1169,32 @@ private Errors validateAlterPartitionData(
             }
         }
 
+        List<BrokerEpochMismatchReplica> brokerEpochMismatchReplicas =
+            
brokerEpochMismatchReplicasForIsr(partitionData.newIsrWithEpochs());
+        if (!brokerEpochMismatchReplicas.isEmpty()) {
+            log.info("Rejecting AlterPartition request from node {} for {}-{} 
because " +
+                    "it specified some invalid ISR members {} that the broker 
epochs mismatch.",
+                    brokerId, topic.name, partitionId, 
brokerEpochMismatchReplicas);
+
+            return INELIGIBLE_REPLICA;
+        }
+
         return Errors.NONE;
     }
 
+    private List<BrokerEpochMismatchReplica> 
brokerEpochMismatchReplicasForIsr(List<BrokerState> brokerStates) {

Review Comment:
   I wonder if we could combine this with ineligibleReplicasForIsr. Did you 
consider/try this?



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