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

Round Robin Kafka Producer Routes to only half the partitions when even number of partitions

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 2.7.0, 3.0.0
    • None
    • producer
    • None

    Description

      When you have 1 message per batch, in the round robin Partitioner. The messages go only to half the partitions beacuse it always skips 1 partition. This works out for odd number of partitions because skipping 1 will mean all partitions get a hit eventually, but with an even number half the partitions never get selected.

       

      So if you have partitions 1, 2, 3, 4 

      Message 1: Partion 1

      Message 2: Partion 3

      Message 3: Partion 1 ... so on. [ Here 2 and 4 are never selected]

       

      If you have partitions 1, 2, 3

      Message 1: Partion 1

      Message 2: Partion 3

      Message 3: Partion 2 .. so on

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            dgunap David G
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: