Dear Kafka community, In the doc -> https://kafka.apache.org/documentation/#distributionimpl 4. sort Pt (so partitions on the same broker are clustered together) and During rebalancing, we try to assign partitions to consumers in such a way that reduces the number of broker nodes each consumer has to connect to
If I get it correctly, it means when sorting the partitions, firstly it is sorted by leader. Then among those partitions which have the same leader, then it is sorted by partition id in numeric order. While the code of RangeAssignor of https://github.com/apache/kafka/blob/trunk/core/src/main/scala/kafka/consumer/PartitionAssignor.scala seems tell that it is sorted only on partition, not on leader. My trial also demonstrated that the code is correct. Is the doc out of date? Or the doc follows some previous versions of Kafka? Or my understanding on code has something wrong? Please kindly advise, thanks!! -- 李响 Xiang Li 邮件 e-mail :wate...@gmail.com