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

Kafka consumer rebalance issue, offsets points back to very old committed offset

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.8.1
    • None
    • consumer, offset manager
    • None
    • Production

    Description

      Hi All,

      We are facing an issue while the client consumer restart (again not all restarts are ending up with this issue) and during the re-balancing scenario, sometimes one of the partition offsets goes back a long way from the committed offset.

      Scenario :

      Assume we have 4 instances of consumer and restarts of consumer one after the other.

      1. At the time of starting restarts assume the offset on partition 10 of a topic being consumed is pointing to 50000. (last offset of the topic and 0 lag)
      2. When restarts start (rebalancing) suddenly the offsets start pointing to 20000.
      3. While all the restarts are going on the consumer who is attached starts reading from 20000 and goes on.
      4. Once all rebalance is completed, and all messages from 20000 to 50000 offset has been read (where it had stopped initially)
        We end up having around 30K duplicates.

      (The numbers here are just an example, in production, we are facing huge duplicates and every two rebalance during restarts of consumer out of 10 restart exercise activity ends up in such duplicates and not all partitions and only one or two partitions behave this way and randomly)

      This seems to be a bug. I am attaching all screenshots for reference as well.

      Can someone kindly help out here?

      Attachments

        1. image-2022-11-30-17-58-15-046.png
          28 kB
          Chetan
        2. image-2022-11-30-18-10-37-180.png
          90 kB
          Chetan
        3. image-2022-11-30-18-29-36-445.png
          11 kB
          Chetan
        4. rebalance issue.docx
          35 kB
          Chetan

        Activity

          People

            Unassigned Unassigned
            Chetu Chetan
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: