[ https://issues.apache.org/jira/browse/KAFKA-14456?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Andrew Grant updated KAFKA-14456: --------------------------------- Description: When new partitions are added/created we calculate a start index based off all the brokers here [https://github.com/apache/kafka/blob/trunk/core/src/main/scala/kafka/zk/AdminZkClient.scala#L270.] That start index is passed through to AdminUtils and is used to find a starting position in the list of brokers for making assignments. However, when we make rack aware assignments we use that index into a rack alternating list here [https://github.com/apache/kafka/blob/trunk/core/src/main/scala/kafka/admin/AdminUtils.scala#L160.] The meaning of the index gets lost: the index into the full list of brokers doesnt seem to have the same meaning as the index into a rack alternating list. I discovered this when I published [https://github.com/apache/kafka/pull/12943/files.] In that PR I added a test testRackAwarePartitionAssignment which does not work for ZK mode. was: When new partitions are added/created we calculate a start index based off all the brokers here [https://github.com/apache/kafka/blob/trunk/core/src/main/scala/kafka/zk/AdminZkClient.scala#L270.] That start index is passed through to AdminUtils and is used to find a starting position in the list of brokers for making assignments. However, when we make rack aware assignments we use that index into a rack alternating list here [https://github.com/apache/kafka/blob/trunk/core/src/main/scala/kafka/admin/AdminUtils.scala#L160.] The meaning of the index gets lost: the index into the full list of brokers doesnt seem to have the same meaning as the index into a rack alternating list. I discovered this when I published [https://github.com/apache/kafka/pull/12943/files.] In that PR I added a test testRackAwarePartitionAssignment which does not work for ZK mode. > Fix AdminUtils startIndex for rack aware partition creations > ------------------------------------------------------------- > > Key: KAFKA-14456 > URL: https://issues.apache.org/jira/browse/KAFKA-14456 > Project: Kafka > Issue Type: Improvement > Reporter: Andrew Grant > Priority: Major > > When new partitions are added/created we calculate a start index based off > all the brokers here > [https://github.com/apache/kafka/blob/trunk/core/src/main/scala/kafka/zk/AdminZkClient.scala#L270.] > That start index is passed through to AdminUtils and is used to find a > starting position in the list of brokers for making assignments. However, > when we make rack aware assignments we use that index into a rack alternating > list here > [https://github.com/apache/kafka/blob/trunk/core/src/main/scala/kafka/admin/AdminUtils.scala#L160.] > The meaning of the index gets lost: the index into the full list of brokers > doesnt seem to have the same meaning as the index into a rack alternating > list. > I discovered this when I published > [https://github.com/apache/kafka/pull/12943/files.] In that PR I added a test > testRackAwarePartitionAssignment which does not work for ZK mode. -- This message was sent by Atlassian Jira (v8.20.10#820010)