I was looking into the way kafka-manager assign partitions during addPartition operation to check if it behaves the same way as with topic creation. Let assume that we have 6 brokers and topic with 9 partitions and replication factor = 2. Data will be distributed not evenly among the brokers:
Even if the assignment doesn't try to behave as I described above, could you explain what is the reason to use id of the first replica of one of the partitions, rather than just use random? Does it improve the distribution of partitions somehow?
I was looking into the way kafka-manager assign partitions during addPartition operation to check if it behaves the same way as with topic creation. Let assume that we have 6 brokers and topic with 9 partitions and replication factor = 2. Data will be distributed not evenly among the brokers:
Then we add 3 partitions, and want them to be distributed the following way:
Does current assignment algorithm try to do the same? Seems that not, as for initial shift it gets head of partitionReplicaList which effectively could be random partition.https://github.com/yahoo/kafka-manager/blob/master/app/kafka/manager/utils/AdminUtils.scala#L219 Also, it is not clear what is the idea behind using the same fixedStartIndex if it is specified for both first and second replica shift https://github.com/yahoo/kafka-manager/blob/master/app/kafka/manager/utils/AdminUtils.scala#L75
Even if the assignment doesn't try to behave as I described above, could you explain what is the reason to use id of the first replica of one of the partitions, rather than just use random? Does it improve the distribution of partitions somehow?