Skip to content
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

[Draft] [fix] [broker] Add a limitation of max memory usage of the replay queue #20169

Conversation

poorbarcode
Copy link
Contributor

Motivation

In mode Key_Shared, Pulsar will deliver messages with different keys to different consumers. The message list with the same key is often not continuous, and Pulsar will not stop delivering messages to the client if some consumers cannot continue to acknowledge messages[1], Pulsar just put the messages that were meant for the stuck consumer into the replay queue[2], which makes the replay queue costs more and more messages until memory ran out.

[1]: https://github.com/apache/pulsar/blob/master/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentStickyKeyDispatcherMultipleConsumers.java#L450
[2]: https://github.com/apache/pulsar/blob/master/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentStickyKeyDispatcherMultipleConsumers.java#L273-L282

Modifications

Add a limitation of max memory usage of the replay queue( Only do this if a consumer is not working properly ).

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

Matching PR in forked repository

PR in forked repository:

  • 1

@poorbarcode poorbarcode changed the title [fix] [broker] Add a limitation of max memory usage of the replay queue [Draft] [fix] [broker] Add a limitation of max memory usage of the replay queue Apr 23, 2023
@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Apr 23, 2023
@github-actions
Copy link

The pr had no activity for 30 days, mark with Stale label.

@github-actions github-actions bot added the Stale label May 24, 2023
@tisonkun tisonkun marked this pull request as draft June 15, 2023 13:55
@Technoboy- Technoboy- added this to the 3.2.0 milestone Jul 31, 2023
@Technoboy- Technoboy- modified the milestones: 3.2.0, 3.3.0 Dec 22, 2023
@coderzc coderzc modified the milestones: 3.3.0, 3.4.0 May 8, 2024
@lhotari
Copy link
Member

lhotari commented Oct 9, 2024

#23231 added limits for the replay. closing this.

@lhotari lhotari closed this Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc-not-needed Your PR changes do not impact docs Stale
Development

Successfully merging this pull request may close these issues.

4 participants