-
-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
autocommitting: only commit previously polled fetches
Before this commit, autocommitting could lead to message loss. If fetches were polled, and then an autocommit happened before any messages were processed, and then the process crashed, all polled messages would be lost. Now, we only allow *previously* polled fetches to be committed. The assumption is that PollFetches is only called application-side when all previously polled fetches are finalized within the application (processed / ready to be committed). This new behavior ensures at-least-once message processing at all layers, but does have a risk of duplicates during rebalances. This new behavior also showed that passing the group context to OnRevoke was insufficient: if we used the group context to commit when a group is being left (which triggers OnRevoke before actually leaving), then the commit would fail. The previous recommendation was to commit before leaving. We may as well just use the client context. This *does* mean that users will not be able to detect when a group has exited within the callback, meaning their callback can take so long that they are booted from the group, but that's essentially the previous behavior anyway: the user could do stuff, take so long they're booted, and then fail whatever they're doing *and* be booted from the group. Now they wont fail whatever they're doing, but they'll still be booted from the group. Worst case, we can add the group context back later if the need arises. We also add a few extra logs: in any OnXyz, we log what we entered the callback with, and then potentially call into user callbacks. Closes #57
- Loading branch information
Showing
3 changed files
with
147 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.