Description
Search before asking
- I searched in the issues and found nothing similar.
Motivation
In the current delayed message delivery, there's an opportunity to reduce unnecessary reads to storage.
In Pulsar, there are 2 implementations for the delayed delivery tracker, InMemoryDelayedDeliveryTracker and BucketDelayedDeliveryTracker.
This is configured by the delayedDeliveryTrackerFactoryClassName
configuration key. The default setting chooses the in memory implementation:
Lines 614 to 617 in b02d52c
The BucketDelayedDeliveryTracker contains an optimization to skip messages in reading which have been "indexed":
This already reduces reads when BucketDelayedDeliveryTracker is in use.
The state of the InMemoryDelayedDeliveryTracker gets cleared after all consumers have disconnected:
Solution
It would be useful to keep state also in the InMemoryDelayedDeliveryTracker and skip reading delayed messages when the information is already available for the delivery time of a specific entry.
Alternatives
No response
Anything else?
No response
Are you willing to submit a PR?
- I'm willing to submit a PR!
Activity