-
Notifications
You must be signed in to change notification settings - Fork 779
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
Question: starting offsets - do they work with consumer groups? #711
Comments
Hey @alexec . I suspect that what's happening here is that the pod that you've deleted hasn't gotten a chance to commit any offset before crashing, so the next pod will pick up from
|
Note - the pod does not crash, it is terminated and gracefully shuts down, calling |
Aha! If you're using Lines 714 to 716 in a3150d8
I would suggest either adding a call to |
I'm not using Do I need to do some explicit action to get it to commit the offsets on exit? |
Sorry about that...I just re-read the question and saw that you had stated that you are using I just traced the code, and it looks like there is no guarantee that commits are flushed when the reader is closed. The Lines 272 to 274 in a3150d8
The consumer group is closed by |
I could be possible. Is a manual commit on close possible? |
Yup. At Segment we tend to be processing high volume topics, so we practically never use the immediate commit functionality (it introduces a ton of chatter), so it doesn't surprise me that it's not as battle tested as the interval commit loop. 😅 I dug a little more, and I see that we do a final commit on So all we need to do is add a final commit for the synchronous case. I opened #715, but I don't want to commit it until I get some test coverage on it. You're more than welcome to take the code for a spin to see if it fixes your issue, though. 😄 |
One of my automated FMEA test failed. The test simulates a deletion of a pod and verifies that it re-connects to Kafka and correctly continues to process messages. It lost around 50% of the total messages - this is, not to mince my words, catastrophic.
The diagnostics hinted to me that when the consumer group re-connected, it started at the latest offset.
I recently (maybe coincidentally, maybe causally) added a configuration items to the
ReaderConfig
as follows:My expectation would be that, on first connect it'd use the
StartOffset
, but on re-connect, the consumer group would just continue from the last committed offset.Am I used this incorrectly?
The text was updated successfully, but these errors were encountered: