jsancio commented on code in PR #19296: URL: https://github.com/apache/kafka/pull/19296#discussion_r2031970291
########## metadata/src/main/java/org/apache/kafka/controller/ClusterControlManager.java: ########## @@ -353,7 +353,7 @@ public ControllerResult<BrokerRegistrationReply> registerBroker( if (existing != null) { prevIncarnationId = existing.incarnationId(); storedBrokerEpoch = existing.epoch(); - if (heartbeatManager.hasValidSession(brokerId, existing.epoch())) { + if (heartbeatManager.hasValidSession(brokerId, existing.epoch()) && !existing.fenced() && !existing.inControlledShutdown()) { if (!request.incarnationId().equals(prevIncarnationId)) { throw new DuplicateBrokerRegistrationException("Another broker is " + "registered with that broker id."); Review Comment: @ahuang98 @cmccabe Note that the invalid session message and delay reregistration happens even after controlled shutdown. It is okay to have delays in reregistration during uncontrolled shutdown but not after controlled shutdown. Otherwise, this is a regression from the ZK implementation and behavior. -- 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