Skip to content

Unblock group of consumers on super stream partition #7765

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

Conversation

acogoluegnes
Copy link
Contributor

A group of consumers on a super stream can end up blocked without an active consumer. This can happen with consumer churn: one consumer gets removed, which makes the active consumer passive, but the former active consumer never gets to know because it has been removed itself.

This commit changes the structure of the messages the SAC coordinator sends to consumer connections, to embed enough information to look up the group and to instruct it to choose a new active consumer when the race condition mentioned above comes up.

Because of the changes in the structure of messages, a feature flag is required to make sure the SAC coordinator starts sending the new messages only when all the nodes have been upgraded.

References #7743

@acogoluegnes acogoluegnes force-pushed the rabbitmq-server-7743-unblock-super-stream-partition-consumer-group branch from 1c1e70b to 90eedfa Compare March 31, 2023 08:08
@mergify mergify bot added the bazel label Mar 31, 2023
@Gsantomaggio
Copy link
Member

I can't reproduce the issue 7743 anymore.
I tested it with Java Stream Client and Dotnet stream client.

@michaelklishin michaelklishin marked this pull request as ready for review March 31, 2023 22:57
@michaelklishin michaelklishin modified the milestone: 3.11.14 Mar 31, 2023
@acogoluegnes acogoluegnes force-pushed the rabbitmq-server-7743-unblock-super-stream-partition-consumer-group branch from 83e5c6c to 65c74d8 Compare April 3, 2023 07:58
@acogoluegnes acogoluegnes marked this pull request as draft April 3, 2023 08:02
@acogoluegnes acogoluegnes marked this pull request as ready for review April 3, 2023 09:59
A group of consumers on a super stream can end up blocked
without an active consumer. This can happen with consumer
churn: one consumer gets removed, which makes the active
consumer passive, but the former active consumer never
gets to know because it has been removed itself.

This commit changes the structure of the messages the SAC
coordinator sends to consumer connections, to embed enough
information to look up the group and to instruct it to choose
a new active consumer when the race condition mentioned above
comes up.

Because of the changes in the structure of messages, a feature
flag is required to make sure the SAC coordinator starts
sending the new messages only when all the nodes have been upgraded.

References #7743
And squash a dialyzer warning.
The stream plugin can send frames to a client connection
and expect a response from it. This is used currently
for the consumer_update frame (single active consumer feature).
There was no timeout mechanism so far, so a slow or blocked
application could prevent a group of consumers to move on.

This commit introduces a timeout mechanism: if the expected
response takes too long to arrive, the server assumes the
connection is blocked and closes it.

The default timeout is 60 seconds but it can be changed by setting
the request_timeout parameter of the rabbitmq_stream application.

Note the mechanism does not enforce the exact duration of the timeout,
as a timer is set for the first request and re-used for other requests.
With bad timing, a request can time out after twice as long
as the set-up timeout.

References #7743
@mergify mergify bot added the make label Apr 4, 2023
@michaelklishin michaelklishin merged commit 7418c1a into main Apr 4, 2023
@michaelklishin michaelklishin deleted the rabbitmq-server-7743-unblock-super-stream-partition-consumer-group branch April 4, 2023 17:25
michaelklishin added a commit that referenced this pull request Apr 4, 2023
Unblock group of consumers on super stream partition (backport #7765)
michaelklishin added a commit that referenced this pull request Apr 5, 2023
Unblock group of consumers on super stream partition (backport #7765) (backport #7835)
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