mumrah commented on code in PR #14706: URL: https://github.com/apache/kafka/pull/14706#discussion_r1526384089
########## metadata/src/main/java/org/apache/kafka/controller/ReplicationControlManager.java: ########## @@ -1369,7 +1384,23 @@ void handleBrokerInControlledShutdown(int brokerId, long brokerEpoch, List<ApiMe (short) 1)); } generateLeaderAndIsrUpdates("enterControlledShutdown[" + brokerId + "]", - brokerId, NO_LEADER, records, brokersToIsrs.partitionsWithBrokerInIsr(brokerId)); + brokerId, NO_LEADER, NO_LEADER, records, brokersToIsrs.partitionsWithBrokerInIsr(brokerId)); + } + + /** + * Generate the appropriate records to handle a broker registering after unclean shutdown. Review Comment: The first sentence here doesn't really make sense to me. The second sentence is more descriptive of what this method does, maybe we can just keep that one? Or something similar > Create partition change records to remove replicas from any ISR or ELR for brokers doing unclean shutdown. ########## metadata/src/main/java/org/apache/kafka/controller/ReplicationControlManager.java: ########## @@ -582,6 +586,10 @@ public void replay(RemoveTopicRecord record) { updatePartitionDirectories(topic.id, partitionId, partition.directories, null); } + for (int i = 0; i < partition.elr.length; i++) { Review Comment: nit: use a descriptive name instead of `i` -- 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