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

Sticky assignor could assign a partition to multiple consumers (KIP-341)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.3.0
    • clients

    Description

      In the following scenario sticky assignor assigns a topic partition to two consumers in the group:

      1. Create a topic test with a single partition
      2. Start consumer c1 in group sticky-group (c1 becomes group leader and gets test-0)
      3. Start consumer c2  in group sticky-group (c1 holds onto test-0c2 does not get any partition) 
      4. Pause c1 (e.g. using Java debugger) (c2 becomes leader and takes over test-0, c1 leaves the group)
      5. Resume c1

      At this point both c1 and c2 will have test-0 assigned to them.

       

      The reason is c1 still has kept its previous assignment (test-0) from the last assignment it received from the leader (itself) and did not get the next round of assignments (when c2 became leader) because it was paused. Both c1 and c2 enter the rebalance supplying test-0 as their existing assignment. The sticky assignor code does not currently check and avoid this duplication.

       

      Note: This issue was originally reported on StackOverflow.

      Attachments

        Issue Links

          Activity

            People

              vahid Vahid Hashemian
              vahid Vahid Hashemian
              Votes:
              2 Vote for this issue
              Watchers:
              12 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: