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

More optimally balanced partition assignment strategy (new consumer)


    • Type: Improvement
    • Status: Patch Available
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: 2.0.0
    • Component/s: consumer
    • Labels:


      While the roundrobin partition assignment strategy is an improvement over the range strategy, when the consumer topic subscriptions are not identical (previously disallowed but will be possible as of KAFKA-2172) it can produce heavily skewed assignments. As suggested here it would be nice to have a strategy that attempts to assign an equal number of partitions to each consumer in a group, regardless of how similar their individual topic subscriptions are. We can accomplish this by tracking the number of partitions assigned to each consumer, and having the partition assignment loop assign each partition to a consumer interested in that topic with the least number of partitions assigned.

      Additionally, we can optimize the distribution fairness by adjusting the partition assignment order:

      • Topics with fewer consumers are assigned first.
      • In the event of a tie for least consumers, the topic with more partitions is assigned first.

      The general idea behind these two rules is to keep the most flexible assignment choices available as long as possible by starting with the most constrained partitions/consumers.

      This JIRA addresses the new consumer. For the original high-level consumer, see KAFKA-2435.


          Issue Links



              • Assignee:
                noslowerdna Andrew Olson
                noslowerdna Andrew Olson
                Jason Gustafson
              • Votes:
                0 Vote for this issue
                7 Start watching this issue


                • Created: