chia7712 commented on code in PR #20200: URL: https://github.com/apache/kafka/pull/20200#discussion_r2217850586
########## metadata/src/main/java/org/apache/kafka/controller/PartitionChangeBuilder.java: ########## @@ -311,9 +311,10 @@ private boolean canElectLastKnownLeader() { topicId, partitionId, Arrays.toString(partition.lastKnownElr)); return false; } - if (isAcceptableLeader.test(partition.lastKnownElr[0])) { + if (!isAcceptableLeader.test(partition.lastKnownElr[0])) { log.trace("Try to elect last known leader for {}-{} but last known leader is not alive. last known leader={}", Review Comment: Sorry for late reviews. It seems this comment is not totally accurate. The `isAcceptableLeader` could reject the leader if the leader, while still alive, has no available directory for the partition. -- 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