Skip to content

Conversation

@benclive
Copy link
Contributor

What this PR does / why we need it:
If there is no offset for a consumer group & partition, kafka returns -1 which is a special offset for "latest". I am remapping this to -2, which means replay from the start. By using -1, we would start consuming from the latest offset instead of replaying older data in the case where we start a new consumer group, and therefore the latest data would unavailable.

I don't know if this affects environments with long-lived partition-ingesters, but if kafka expires or cleans up a consumer group after some time, we might trigger this on scale up to new partitions and the latest data would be unavailable.

@benclive benclive requested a review from a team as a code owner November 11, 2024 18:13
Copy link
Contributor

@cyriltovena cyriltovena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@benclive benclive merged commit 1b6da11 into main Nov 12, 2024
59 checks passed
@benclive benclive deleted the start-from-beginning-if-no-commit branch November 12, 2024 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2 participants