Skip to content

Conversation

@codelipenghui
Copy link
Contributor

@codelipenghui codelipenghui commented Jul 19, 2022

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 - unacks

Verifying 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)

@codelipenghui codelipenghui marked this pull request as ready for review July 19, 2022 03:49
@codelipenghui codelipenghui added this to the 2.11.0 milestone Jul 19, 2022
@codelipenghui codelipenghui added type/bug The PR fixed a bug or issue reported a bug area/broker release/2.10.2 release/2.9.4 labels Jul 19, 2022
@codelipenghui codelipenghui self-assigned this Jul 19, 2022
@RobertIndie
Copy link
Member

I think this PR can also fix #16663

@lhotari
Copy link
Member

lhotari commented Jul 19, 2022

Is a similar fix needed for other dispatcher implementation classes such as PersistentDispacherSingleActiveConsumer?

@codelipenghui
Copy link
Contributor Author

Is a similar fix needed for other dispatcher implementation classes such as PersistentDispacherSingleActiveConsumer?

@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.

@codelipenghui codelipenghui changed the title [fix][broker] Fix consumer does not abide by the max unacks limitation [fix][broker] Fix consumer does not abide by the max unacks limitation for Shared subscription Jul 19, 2022
mattisonchao pushed a commit that referenced this pull request Jul 25, 2022
…n for Shared subscription (#16670)

(cherry picked from commit 42fe060)
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)
dragonls pushed a commit to dragonls/pulsar that referenced this pull request Oct 21, 2022
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/broker cherry-picked/branch-2.9 Archived: 2.9 is end of life cherry-picked/branch-2.10 doc-not-needed Your PR changes do not impact docs release/2.9.4 release/2.10.2 type/bug The PR fixed a bug or issue reported a bug

Projects

None yet

8 participants