pulsar
pulsar copied to clipboard
Fix delay messages are expired by TTL policy
Signed-off-by: xiaolongran [email protected]
Motivation
The current TTL policy conflicts with delayed messages. The TTL policy does not identify how long to delay messages. When the time of the delayed message is greater than the time specified by TTL, we should give up checking the TTL of the current delayed message, because the time of the delayed message has not yet arrived, we cannot expired these messages.
Modifications
When the TTL is ready to expire the message, check whether the current entry contains the deliverAtTime field. If it contains a delayed message, then check whether the current delayed message time is greater than the ttl time. If it is greater, it means that we cannot expire the current entry at this time. .
@wolfstudy:Thanks for your contribution. For this PR, do we need to update docs? (The PR template contains info about doc, which helps others know more about the changes. Can you provide doc-related info in this and future PR descriptions? Thanks)
@wolfstudy:Thanks for providing doc info!
Small Question:
Why don't we cherry-pick this PR to branch 2.10?
Another question about this PR:
For pulsar, does the delayed message have a higher priority than TTL?
The pr had no activity for 30 days, mark with Stale label.
Sorry, I forgot to follow up on this change follow-up, now add a test case for this.
PTAL again, @eolivelli @merlimat thanks.
@wolfstudy Please add the following content to your PR description and select a checkbox:
- [ ] `doc` <!-- Your PR contains doc changes -->
- [ ] `doc-required` <!-- Your PR changes impact docs and you will update later -->
- [ ] `doc-not-needed` <!-- Your PR changes do not impact docs -->
- [ ] `doc-complete` <!-- Docs have been already added -->
very good
I left one suggestion in order to save resources and GC time
Hello @eolivelli, PTAL again thanks.
ping @eolivelli PTAL again, thanks
ping @eolivelli PTAL again, thanks
/pulsar-bot rereun-failure-checks
@wolfstudy hi, I move this PR to release/2.9.5, if you have any questions, please ping me. thanks.
The pr had no activity for 30 days, mark with Stale label.
Since we will start the RC version of 3.0.0 on 2023-04-11, I will change the label/milestone of PR who have not been merged.
- The PR of type
featureis deferred to3.1.0 - The PR of type
fixis deferred to3.0.1
So drag this PR to 3.0.1
As discussed on the mailing list https://lists.apache.org/thread/w4jzk27qhtosgsz7l9bmhf1t7o9mxjhp, there is no plan to release 2.9.6, so I am going to remove the release/2.9.6 label