Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(kafka): Read from beginning if no committed offset #14865

Merged
merged 1 commit into from
Nov 12, 2024

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants