Skip to content

Conversation

mikkolaj
Copy link

Related to #421.

Proposed changeset:

  1. Clear state of revoked partitions in AtmostOnceOffsets
  2. Correct off-by-one error in offsets committed after undoCommitAhead

Mikołaj Bul and others added 2 commits April 13, 2025 16:57
During graceful shutdown at-most-once Kafka consumer with
atmostOnceCommitAheadSize option configured reverts offsets committed
ahead and commits offsets of the latest records dispatched down
the stream. The offsets were off by one and after undoCommitAhead
consumer group was left with consumer lag of -1.

Signed-off-by: Mikołaj Bul <mikolajbul@gmail.com>
…head

During graceful shutdown at-most-once Kafka consumer with
atmostOnceCommitAheadSize option configured can commit offsets
on partitions that have been revoked from it. This might break
processing guarantees for other consumers by making them process
records multiple times. To address this issue another action was
added to onPartitionsRevoked hook - offsets of revoked partitions
are cleared from AtmostOnceOffsets class.

Signed-off-by: Mikołaj Bul <mikolajbul@gmail.com>
…tions

Closing the consumer happens after performing undoCommitAhead.
Ensure no race conditions are present in undoCommitAhead assertions
by waiting for the consumer to close.

Signed-off-by: Mikołaj Bul <mikolajbul@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant