GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [fix][broker] Bound classic Key_Shared dispatcher replay queue look-ahead by poorbarcode · Pull Request #26677 · apache/pulsar

Conversation

@poorbarcode

@poorbarcode poorbarcode commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

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:

  • There were 12 consumers
  • consumer#xzqg9 was slow; other consumers have consumed all messages that they can.
  • The dispatcher keeps reading entries and pushing messages(which should be consumed by consumer#xzqg9) into the redeliver queue since consumer#xzqg9's permits is 0.
  • Eventually, the queue is too large, causing broker OOM.

Modifications

Let classic Key_Shared dispatcher support the configuration keySharedLookAheadMsgInReplayThresholdPerSubscription

Does this pull request potentially affect one of the following parts:

If the box was checked, please highlight the changes

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@poorbarcode poorbarcode added this to the 5.0.0 milestone Sep 21, 2026
@poorbarcode poorbarcode self-assigned this Sep 21, 2026
@poorbarcode poorbarcode added ready-to-test release/4.2.5 release/4.0.14 labels Sep 21, 2026
@poorbarcode
[fix][broker] Bound classic Key_Shared dispatcher replay queue look-a…
e2f55c7
…head
@poorbarcode
poorbarcode force-pushed the pause_if_rediliver_queue_full branch from 417677b to e2f55c7 Compare September 22, 2026 08:53
Technoboy-
Technoboy- approved these changes Sep 22, 2026
View reviewed changes

@Technoboy- Technoboy- left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Demogorgon314
Demogorgon314 approved these changes Sep 22, 2026
View reviewed changes
@poorbarcode
poorbarcode merged commit 3d5fbc3 into apache:master Sep 22, 2026
81 of 83 checks passed

Uh oh!

There was an error while loading. Please reload this page.

poorbarcode added a commit that referenced this pull request Sep 22, 2026
@poorbarcode
[fix][broker] Bound classic Key_Shared dispatcher replay queue look-a…
bb7aea7
…head (#26677)

(cherry picked from commit 3d5fbc3)
poorbarcode added a commit that referenced this pull request Sep 22, 2026
@poorbarcode
[fix][broker] Bound classic Key_Shared dispatcher replay queue look-a…
3745691
…head (#26677)

(cherry picked from commit 3d5fbc3)
@poorbarcode poorbarcode added cherry-picked/branch-4.0 cherry-picked/branch-4.2 labels Sep 22, 2026
@lhotari

lhotari commented Sep 22, 2026

Copy link
Copy Markdown
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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@lhotari lhotari mentioned this pull request Sep 22, 2026
[improve][broker] PIP-379: Remove the classic Shared and Key_Shared dispatcher implementations #26687
Merged
4 of 11 tasks
Radiancebobo pushed a commit to Radiancebobo/pulsar that referenced this pull request Oct 8, 2026
@poorbarcode hechengbo
[fix][broker] Bound classic Key_Shared dispatcher replay queue look-a…
aa0b0df
…head (apache#26677)
nodece pushed a commit to ascentstream/pulsar that referenced this pull request Nov 6, 2026
@poorbarcode @nodece
[fix][broker] Bound classic Key_Shared dispatcher replay queue look-a…
18d4c05
…head (apache#26677)

(cherry picked from commit 3d5fbc3)
nodece pushed a commit to ascentstream/pulsar that referenced this pull request Nov 16, 2026
@poorbarcode @nodece
[fix][broker] Bound classic Key_Shared dispatcher replay queue look-a…
f23ec00
…head (apache#26677)

(cherry picked from commit 3d5fbc3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@Technoboy- Technoboy- Technoboy- approved these changes
@Demogorgon314 Demogorgon314 Demogorgon314 approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@poorbarcode poorbarcode

Labels

cherry-picked/branch-4.0 cherry-picked/branch-4.2 ready-to-test release/4.0.14 release/4.2.5

Projects

None yet

Milestone

5.0.0

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@poorbarcode @lhotari @Technoboy- @Demogorgon314
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.