-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Dispatch messages to the new consumer after exist consumer acknowledged all dispatched messages in Key_Shared Subscription. #6554
Comments
Let me add a related issue and some discussion I and @codelipenghui had about this.
I think sticky consumers won't really solve it since consumers can be easily down in failure cases and it is pretty hard for applications to manage scalability of consumers. |
How come this is marked as a feature and not a bug? It violates the ordering guarantee of Key_Shared, and basically makes Key_Shared useless if you dynamically add consumers. I ask, because I would like to ensure this bug gets the proper attention, and is not regarded as a nice-to-have feature. |
@codelipenghui Could you share updates on this if any ? |
@feeblefakie We are already advancing this matter and I have drafted an approach. I will create a PIP or push a PR soon. |
@codelipenghui Thank you for sharing the update ! Good to know. :) |
So, I think the problem here should be treated by having new consumers joining in a "paused" state. For example, consider this sequence:
Essentially, |
@merlimat |
Yes, the above proposal takes care of that. The important point is that X could be re-sent to |
@merlimat I like the approach you have mentioned. |
@pouledodue @feeblefakie @merlimat I have pushed a PR #6977 for this issue. Please help review, thanks. |
) ### Motivation Fixes: #6554 Ordering is broken in KeyShared dispatcher if a new consumer `c2` comes in and an existing consumer `c1` goes out. This is because messages with keys previously assigned to `c1` may now route to `c2`. The solution here is to have new consumers joining in a "paused" state. For example, consider this sequence: 1. Subscriptions has `c1` and `c2` consumers 2. `c3` joins. Some of the keys are now supposed to go to `c3`. 3. Instead of starting delivering to `c3`. We mark the current readPosition (let's call it `rp0_c3`) of the cursor for `c3`. 4. Any message that now hashes to `c3` and that has `messageId >= rp0_c3` will be deferred for later re-delivery 5. Any message that might get re-delivered (eg: originally sent to `c1`, but `c1` has failed) to `c3` and that has `messageId < rp0_c3` will be sent to `c3` 6. When the markDelete position of the cursor will move past `rp0_c3` the restriction on `c3` will be lifted. Essentially, `c3` joins but can only receive old messages, until everything that was read before joining gets acked.
Reopen it via #5819 (comment). |
PR #7106 referred to by #5819 (comment) is marked as closed and merged, with milestone 2.6.0. Should this issue be closed with 2.6.0 milestone after all? |
@rocketraman As discussed with @feeblefakie in slack channel, looks there are some problems with auto split mechanism. So I reopen this issue for tracking this problem. And @feeblefakie has verified consistent hash mechanism is work as expected. I will take a look at the auto split mechanism later. |
@codelipenghui Should I create an open issue for this ? |
@feeblefakie Yes, thanks. |
@codelipenghui #7455 PTAL. |
…ache#7106) ### Motivation Fixes: apache#6554 Ordering is broken in KeyShared dispatcher if a new consumer `c2` comes in and an existing consumer `c1` goes out. This is because messages with keys previously assigned to `c1` may now route to `c2`. The solution here is to have new consumers joining in a "paused" state. For example, consider this sequence: 1. Subscriptions has `c1` and `c2` consumers 2. `c3` joins. Some of the keys are now supposed to go to `c3`. 3. Instead of starting delivering to `c3`. We mark the current readPosition (let's call it `rp0_c3`) of the cursor for `c3`. 4. Any message that now hashes to `c3` and that has `messageId >= rp0_c3` will be deferred for later re-delivery 5. Any message that might get re-delivered (eg: originally sent to `c1`, but `c1` has failed) to `c3` and that has `messageId < rp0_c3` will be sent to `c3` 6. When the markDelete position of the cursor will move past `rp0_c3` the restriction on `c3` will be lifted. Essentially, `c3` joins but can only receive old messages, until everything that was read before joining gets acked.
The issue will be tracked in #7455 so move the issue to release/2.6.2 |
…ache#7106) ### Motivation Fixes: apache#6554 Ordering is broken in KeyShared dispatcher if a new consumer `c2` comes in and an existing consumer `c1` goes out. This is because messages with keys previously assigned to `c1` may now route to `c2`. The solution here is to have new consumers joining in a "paused" state. For example, consider this sequence: 1. Subscriptions has `c1` and `c2` consumers 2. `c3` joins. Some of the keys are now supposed to go to `c3`. 3. Instead of starting delivering to `c3`. We mark the current readPosition (let's call it `rp0_c3`) of the cursor for `c3`. 4. Any message that now hashes to `c3` and that has `messageId >= rp0_c3` will be deferred for later re-delivery 5. Any message that might get re-delivered (eg: originally sent to `c1`, but `c1` has failed) to `c3` and that has `messageId < rp0_c3` will be sent to `c3` 6. When the markDelete position of the cursor will move past `rp0_c3` the restriction on `c3` will be lifted. Essentially, `c3` joins but can only receive old messages, until everything that was read before joining gets acked.
It seems that #8292 has solved this problem, let us consider closing this issue. |
Master issue #4077
Is your feature request related to a problem? Please describe.
Dispatch messages to the new consumer after exist consumer acknowledged all dispatched messages in Key_Shared Subscription.
The text was updated successfully, but these errors were encountered: