-
Notifications
You must be signed in to change notification settings - Fork 386
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
CommittableOffsetBatchImpl allow reordering #1285
Comments
Thank you for discussing this here. Reordering of messages and thus committing offsets wrong causes nasty bugs and Alpakka Kafka can get better at avoiding it. For case 1. I agree that we should stop lowering the offset for a topic partition right in the batch implementation (note that there is logic to avoid committing lower offsets in For case 2. I wouldn't want to change anything, in many scenarios it is valid to just filter out messages (and offsets). |
@ennru Other approach would be just adding logging in CommittableOffsetBatch and CommitObservationLogic.updateBatch for the first scenario. |
If you're willing to try this out that would be great. |
+1 for this. I experienced some issues with this where offsets would never reach 0 because of the use of I wouldn't want to start a discussion of what correct behavior for this is, but it would be great if Alpakka would at least warn that offsets are commited in the wrong order and this may produce undesired / surprising results. |
Agreed, I created #1305 to track this specifically. @EgbertW if you're willing we'd welcome a PR! Regarding @Matzz 2nd request I don't see the value warning the user of "skipped" offset commits since it's a common practice to batch or skip records during processing. |
Short description
Commiting older offset after newer in CommittableOffsetBatchImpl will override it.
Details
There two main problems I would like to discuss here:
In my opinion there should be an option to log an error or throw an exception in such case. At the first glance, it affects only at most once delivery. However, this behavior could be a problem for low traffic topics. We will observe a lag in metrics until we will receive next message on that partition. And sometimes it could take days. Such problems are very hard to debug. In my case my code was faulty due to using
flatMapMerge
instead offlatMapConcat
.I understand that
CommittableOffsetBatch
may not catch problems between independent batches. But I think logging such issues within a the same batch is possible and beneficial. Of course it could be configurable and optional.I'm not entirely sure about that. But I think for at least once delivery it should be possible to log in such case (optional)
I could implement that feature however I that expected behavior should be discussed first.
Regards,
Matzz
The text was updated successfully, but these errors were encountered: