hachikuji commented on code in PR #12187: URL: https://github.com/apache/kafka/pull/12187#discussion_r878712671
########## core/src/main/scala/kafka/server/ReplicaManager.scala: ########## @@ -2134,10 +2141,13 @@ class ReplicaManager(val config: KafkaConfig, stateChangeLogger.trace(s"Unable to start fetching $tp with topic " + s"ID ${info.topicId} because the replica manager is shutting down.") } else { - val leader = info.partition.leader - if (newImage.cluster.broker(leader) == null) { + if (isInControlledShutdown && !info.partition.isr.contains(config.brokerId)) { Review Comment: I wonder if we should also count the case when the replica is in the ISR, but no leader is defined. I think this is what we would see if the shutting down replica is the last member of the ISR. -- 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