You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2021/11/01 22:40:19 UTC

[GitHub] [kafka] junrao commented on a change in pull request #11453: createTopic need sort brokerMetadata

junrao commented on a change in pull request #11453:
URL: https://github.com/apache/kafka/pull/11453#discussion_r740573525



##########
File path: core/src/main/scala/kafka/server/ZkAdminManager.scala
##########
@@ -152,7 +152,7 @@ class ZkAdminManager(val config: KafkaConfig,
                    responseCallback: Map[String, ApiError] => Unit): Unit = {
 
     // 1. map over topics creating assignment and calling zookeeper
-    val brokers = metadataCache.getAliveBrokers()
+    val brokers = metadataCache.getAliveBrokers().toList.sortBy(_.id)

Review comment:
       Could we add a comment why we want to sort the broker by ids?




-- 
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-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org