chia7712 commented on code in PR #20203:
URL: https://github.com/apache/kafka/pull/20203#discussion_r2483776387
##########
storage/src/main/java/org/apache/kafka/server/log/remote/metadata/storage/TopicBasedRemoteLogMetadataManager.java:
##########
@@ -376,6 +374,26 @@ private void
initializeResources(TopicBasedRemoteLogMetadataManagerConfig rlmmCo
}
}
+ /**
+ * Invoked when the broker is ready to handle requests. This triggers the
initialization of
+ * resources including Kafka clients that operate on the remote log
metadata topic.
+ * <p>
+ * The target cluster for the topic is determined by configuration and can
be either:
+ * <ol>
+ * <li>The local cluster (most common) - the initialization is deferred
until the broker is ready
+ * to handle requests. Early initialization would lead to connection
failures.</li>
+ * <li>A remote cluster - the delay is not necessary but causes no
harm.</li>
+ * </ol>
+ * <p>
+ * By using the broker ready state as the initialization trigger, the
implementation optimally handles
+ * the typical case while remaining correct for alternative configurations.
+ */
+ @Override
+ public void onBrokerReady() {
+ log.info("Broker is ready for requests, now initializing topic-based
RLMM resources");
Review Comment:
Since `initializeResources` already logs `Initializing topic-based RLMM
resources`. This duplicate log may not be necessary
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]