divijvaidya commented on code in PR #13828:
URL: https://github.com/apache/kafka/pull/13828#discussion_r1226373376


##########
core/src/main/scala/kafka/server/BrokerServer.scala:
##########
@@ -474,7 +474,14 @@ class BrokerServer(
       new KafkaConfig(config.originals(), true)
 
       // Start RemoteLogManager before broker start serving the requests.
-      remoteLogManager.foreach(_.startup())
+      remoteLogManagerOpt.foreach(rlm => {
+        val listenerName = 
ListenerName.normalised(config.remoteLogManagerConfig.remoteLogMetadataManagerListenerName())
+        endpoints.stream.filter(e => e.listenerName.equals(listenerName))
+          .findAny()

Review Comment:
   I would prefer to have findFirst here to keep the logic of choosing 
endpoints deterministic in the code. For example, in situations where we have 
multiple endpoints for the same listener name, this code might choose any 
random one (based on streams implementation) and if only one of the endpoints 
is incorrect, it will "sometimes" fail and sometimes it won't. 
   Making it deterministic provides us with consistent experience.
   
   (same for KafkaServer)



-- 
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

Reply via email to