eolivelli opened a new pull request, #18245:
URL: https://github.com/apache/pulsar/pull/18245

   ### Motivation
   
   Broker can go out of memory due to many reads enqueued on the 
PersistentDispatcherMultipleConsumers dispatchMessagesThread (that is used in 
case of dispatcherDispatchMessagesInSubscriptionThread set to true, that is the 
default value) The limit of the amount of memory retained due to reads MUST 
take into account also the entries coming from the Cache.
   
   When dispatcherDispatchMessagesInSubscriptionThread is false (the behaviour 
of Pulsar 2.10) there is some kind of natural (but still unpredictable!!) back 
pressure mechanism because the thread that receives the entries from BK of the 
cache dispatches immediately and synchronously the entries to the consumer and 
releases them
   
   ### Modifications
   
   - Add a new component (InflightReadsLimiter) that keeps track of the overall 
amount of memory retained due to inflight reads.
   - Add a new configuration entry managedLedgerMaxReadsInFlightSizeInMB
   - The feature is disabled by default
   - Add new metrics to track the status of the broker
   
   
   ### Documentation
   
   <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
   
   - [ ] `doc` <!-- Your PR contains doc changes. Please attach the local 
preview screenshots (run `sh start.sh` at `pulsar/site2/website`) to your PR 
description, or else your PR might not get merged. -->
   - [ ] `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: 
   


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

Reply via email to