[fix][broker] Fix consumer does not abide by the max unacks limitation for Shared subscription - #16670
Merged
Merged
Conversation
codelipenghui
marked this pull request as ready for review
July 19, 2022 03:49
RobertIndie
approved these changes
Jul 19, 2022
Member
|
I think this PR can also fix #16663 |
shibd
approved these changes
Jul 19, 2022
Technoboy-
approved these changes
Jul 19, 2022
Member
|
Is a similar fix needed for other dispatcher implementation classes such as PersistentDispacherSingleActiveConsumer? |
lhotari
approved these changes
Jul 19, 2022
Contributor
Author
@lhotari Oh, good point. I will take a look at the Key_Shared subscription, It's might different from Shared subscription. For the single active consumer subscription, we don't have unacks limitations for now, so we don't need a fix for it. |
Demogorgon314
approved these changes
Jul 19, 2022
HQebupt
approved these changes
Jul 19, 2022
This was referenced Jul 20, 2022
nicoloboschi
pushed a commit
to datastax/pulsar
that referenced
this pull request
Aug 16, 2022
…n for Shared subscription (apache#16670) (cherry picked from commit 42fe060) (cherry picked from commit 8840591)
2 tasks
dragonls
pushed a commit
to dragonls/pulsar
that referenced
this pull request
Oct 21, 2022
…n for Shared subscription (apache#16670)
dragonls
pushed a commit
to dragonls/pulsar
that referenced
this pull request
Oct 21, 2022
…release' (merge request !67) branch-2.9-fix-somebug-key-share [fix][broker] Multiple consumer dispatcher stuck when unackedMessages greater than maxUnackedMessages (apache#17483) [fix][broker] Fix consumer does not abide by the max unacks limitation for Key_Shared subscription apache#16718 [fix][broker] Fix consumer does not abide by the max unacks limitation for Shared subscription apache#16670
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #16667 #16673
Motivation
Fix the consumer does not abide by the max unacks limitation.
The root cause is the dispatcher only cares about the flow permits while
dispatching messages but doesn't care if the dispatched messages
will exceed the max unacks limitation.
The issue is easy to reproduce if max_unacks < receiver_queue_size
Modifications
Calculate the dispatch messages count for a consumer with
max_unacks - unacksVerifying this change
A new test added to verify the consumer will not receive
messages more than max unacks limitation
Documentation
Check the box below or label this PR directly.
Need to update docs?
doc-required(Your PR needs to update docs and you will update later)
doc-not-needed(Please explain why)
doc(Your PR contains doc changes)
doc-complete(Docs have been already added)