Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-5928

Avoid redundant requests to zookeeper when reassign topic partition

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.10.2.1, 0.11.0.0, 1.0.0, 2.0.0
    • Fix Version/s: 2.1.0
    • Component/s: admin
    • Labels:
      None

      Description

      We mistakenly request topic level information according to partitions config in the assignment json file. For example https://github.com/apache/kafka/blob/trunk/core/src/main/scala/kafka/admin/ReassignPartitionsCommand.scala#L550:

      val validPartitions = proposedPartitionAssignment.filter { case (p, _) => validatePartition(zkUtils, p.topic, p.partition) } 
      

      If reassign 1000 partitions (in 10 topics), we need to request zookeeper 1000 times here. But actually we only need to request just 10 (topics) times. We test a large-scale assignment, about 10K partitions. It takes tens of minutes. After optimization, it will reduce to less than 1minute.

        Attachments

          Activity

            People

            • Assignee:
              uncleGen Genmao Yu
              Reporter:
              uncleGen Genmao Yu
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: