showuon commented on code in PR #16866: URL: https://github.com/apache/kafka/pull/16866#discussion_r1733911255
########## metadata/src/main/java/org/apache/kafka/controller/ReplicationControlManager.java: ########## @@ -1631,8 +1617,12 @@ boolean arePartitionLeadersImbalanced() { return !imbalancedPartitions.isEmpty(); } + boolean areSomePartitionsLeaderless() { + return brokersToIsrs.partitionsWithNoLeader().hasNext(); + } + /** - * Attempt to elect a preferred leader for all topic partitions which have a leader that is not the preferred replica. + * Check if we can do an election for partitions with no leader or a leader other than the preferred one. Review Comment: nit: We need to revert this javadoc change. -- 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