Repository navigation
[fix][broker] Bound classic Key_Shared dispatcher replay queue look-ahead - #26677
Merged
poorbarcode merged 1 commit intoSep 22, 2026
Merged
Conversation
poorbarcode
force-pushed
the
pause_if_rediliver_queue_full
branch
from
September 22, 2026 08:53
417677b to
e2f55c7
Compare
Demogorgon314
approved these changes
Sep 22, 2026
Member
|
@poorbarcode I'm just wondering why wouldn't users just use the current dispatcher instead of the legacy one. The current PIP-379 has been available for almost 2 years and it has been battle tested by the majority of all Pulsar users in the community. Most users don't disable PIP-379. After 4.0.x there has been a very critical fixes for PIP-379 implementation which have been quickly fixed. At the same time, the legacy dispatcher has a lot of known issues that remain unfixed. |
4 of 11 tasks
Radiancebobo
pushed a commit
to Radiancebobo/pulsar
that referenced
this pull request
Oct 8, 2026
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.
Motivation
In the classic Key_Shared dispatcher, messages are assigned to consumers according to their sticky-key hash. If a consumer becomes slow and exhausts its available permits, messages mapped to that consumer cannot be dispatched. To keep other consumers making progress, the dispatcher continues normal reads and places these undispatchable entries into the in-memory replay queue.
This can cause broker OOM when all of the following conditions hold:
12consumersconsumer#xzqg9was slow; other consumers have consumed all messages that they can.consumer#xzqg9) into the redeliver queue sinceconsumer#xzqg9's permits is0.Modifications
Let classic Key_Shared dispatcher support the configuration
keySharedLookAheadMsgInReplayThresholdPerSubscriptionDoes this pull request potentially affect one of the following parts:
If the box was checked, please highlight the changes