poorbarcode opened a new pull request, #20169: URL: https://github.com/apache/pulsar/pull/20169
### 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<sup>[1]</sup>, Pulsar just put the messages that were meant for the stuck consumer into the replay queue<sup>[2]</sup>, which makes the replay queue costs more and more messages until memory ran out. <strong>[1]<strong>: https://github.com/apache/pulsar/blob/master/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentStickyKeyDispatcherMultipleConsumers.java#L450 <strong>[2]<strong>: 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 <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. --> - [ ] `doc` <!-- Your PR contains doc changes. --> - [ ] `doc-required` <!-- Your PR changes impact docs and you will update later --> - [x] `doc-not-needed` <!-- Your PR changes do not impact docs --> - [ ] `doc-complete` <!-- Docs have been already added --> ### Matching PR in forked repository PR in forked repository: - 1 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
