shirenchuang commented on pull request #11453:
URL: https://github.com/apache/kafka/pull/11453#issuecomment-957037691


   Thank you for your reply. I plan to repair the logic in kRaft together. In 
addition, I will add an article to explain why sorting is needed and the 
solution, and of course I will add the corresponding unit test. Thanks again 
for your reply!
   
   
   
   
   ---Original---
   From: "Jun ***@***.***>
   Date: Tue, Nov 2, 2021 06:40 AM
   To: ***@***.***>;
   Cc: ***@***.******@***.***>;
   Subject: Re: [apache/kafka] createTopic need sort brokerMetadata (PR #11453)
   
   
   
   
    
   @junrao commented on this pull request.
    
   @shirenchuang : Thanks for the PR.
     
   Could you add a unit test? 
   
   We are moving the logic in ZK to KRaft. In ReplicationControlManager, it 
seems that createTopics() and createPartitions() don't sort the brokers during 
reassignment. Do you plan to fix the issue there too? If not, I can file a 
separate jira to track that. 
   
    
   In 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)  
   Could we add a comment why we want to sort the broker by ids?
    
   —
   You are receiving this because you were mentioned.
   Reply to this email directly, view it on GitHub, or unsubscribe.
   Triage notifications on the go with GitHub Mobile for iOS or Android.


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