soarez commented on code in PR #14838: URL: https://github.com/apache/kafka/pull/14838#discussion_r1414261999
########## metadata/src/main/java/org/apache/kafka/controller/ClusterControlManager.java: ########## @@ -284,7 +286,7 @@ ReplicaPlacer replicaPlacer() { public void activate() { heartbeatManager = new BrokerHeartbeatManager(logContext, time, sessionTimeoutNs); for (BrokerRegistration registration : brokerRegistrations.values()) { - heartbeatManager.touch(registration.id(), registration.fenced(), -1); + heartbeatManager.register(registration.id(), registration.fenced(), registration.directories()); Review Comment: This is in `clusterControlManager.activate()`, a couple of lines above we reset the heartbeatManager with `heartbeatManager = new BrokerHeartbeatManager(logContext, time, sessionTimeoutNs);`. So no broker will be registered yet with that fresh manager. `register()` here means _register the broker in the heartbeat manager_, not _register the broker with the controller quorum_. If we revert this line change we'll trigger `throw new IllegalStateException("Broker " + brokerId + " is not registered.");` in `brokerHeartbeatManager.touch()`. -- 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