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: Commit offsets from strategy join #4936

Merged
merged 3 commits into from
Oct 30, 2023
Merged

Conversation

untitaker
Copy link
Member

@untitaker untitaker commented Oct 27, 2023

The return value of Strategy.join() is currently ignored, because we
have no access to the consumer from within the assignment callbacks.

Shuffle a few things around so that consumer callbacks contain Arc to
the consumer internally.

SNS-2473

The return value of Strategy.join() is currently ignored, because we
have no access to the consumer from within the assignment callbacks.

Shuffle a few things around so that consumer callbacks contain Arc to
the consumer internally.
@untitaker untitaker requested a review from a team as a code owner October 27, 2023 12:58
@@ -69,7 +76,11 @@ impl<TPayload: 'static + Clone> AssignmentCallbacks for Callbacks<TPayload> {
s.close();
// TODO: We need to actually call consumer.commit() with the commit request.
// Right now we are never committing during consumer shutdown.
let _ = s.join(None);
if let Some(commit_request) = s.join(None) {
Copy link
Member Author

Choose a reason for hiding this comment

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

this is the actual fix we're enabling

Copy link
Member

@lynnagara lynnagara left a comment

Choose a reason for hiding this comment

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

nice!

@lynnagara lynnagara merged commit c7f4213 into master Oct 30, 2023
@lynnagara lynnagara deleted the ref/join-on-shutdown branch October 30, 2023 21:37
@lynnagara
Copy link
Member

This has stopped committing anything in prod, reverting

@getsentry-bot
Copy link
Contributor

revert failed (conflict? already reverted?) -- check the logs

lynnagara added a commit that referenced this pull request Oct 31, 2023
This reverts commit c7f4213.

Consumer has stopped committing entirely, reverting to figure out why
lynnagara added a commit that referenced this pull request Oct 31, 2023
This reverts commit c7f4213.

Consumer has stopped committing entirely, reverting to figure out why
lynnagara added a commit that referenced this pull request Oct 31, 2023
Initial refactoring so that the consumer can be shared and referenced
within the assignment callbacks. This is necessary so we can do things
like call commit on the consumer during rebalance callbacks.

This PR is based on #4936
which had to be reverted as the consumer fully stopped committing
when that was merged. Though this is only the initial refactoring
and does not actually commit during join yet.

At the moment my best guess of why the previous attempt did not work
in prod was the the context was being mutated after the consumer
was initially created. This version avoids doing this and keeps the
original approach of deferring consumer creation until
StreamProcessor.subscribe() is called.
lynnagara added a commit that referenced this pull request Nov 2, 2023
Initial refactoring so that the consumer can be shared and referenced
within the assignment callbacks. This is necessary so we can do things
like call commit on the consumer during rebalance callbacks.

This PR is based on #4936
which had to be reverted as the consumer fully stopped committing
when that was merged. Though this is only the initial refactoring
and does not actually commit during join yet.

At the moment my best guess of why the previous attempt did not work
in prod was the the context was being mutated after the consumer
was initially created. This version avoids doing this and keeps the
original approach of deferring consumer creation until
StreamProcessor.subscribe() is called.
lynnagara added a commit that referenced this pull request Nov 6, 2023
lynnagara added a commit that referenced this pull request Nov 9, 2023
untitaker pushed a commit to getsentry/arroyo that referenced this pull request Jan 17, 2024
Initial refactoring so that the consumer can be shared and referenced
within the assignment callbacks. This is necessary so we can do things
like call commit on the consumer during rebalance callbacks.

This PR is based on getsentry/snuba#4936
which had to be reverted as the consumer fully stopped committing
when that was merged. Though this is only the initial refactoring
and does not actually commit during join yet.

At the moment my best guess of why the previous attempt did not work
in prod was the the context was being mutated after the consumer
was initially created. This version avoids doing this and keeps the
original approach of deferring consumer creation until
StreamProcessor.subscribe() is called.
untitaker pushed a commit to getsentry/arroyo that referenced this pull request Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants