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

[Bug] TTL Cleaned up delay-delivered messages #21898

Open
1 of 2 tasks
KamenRiderKuuga opened this issue Jan 15, 2024 · 4 comments
Open
1 of 2 tasks

[Bug] TTL Cleaned up delay-delivered messages #21898

KamenRiderKuuga opened this issue Jan 15, 2024 · 4 comments
Labels
type/bug The PR fixed a bug or issue reported a bug

Comments

@KamenRiderKuuga
Copy link

Search before asking

  • I searched in the issues and found nothing similar.

Version

pulsar running on docker: apachepulsar/pulsar:3.1.1

Minimal reproduce step

set the broker.conf: ttlDurationDefaultInSeconds=7200
code for sending message:

var messageBuilder = producer.newMessage().value(payload).deliverAfter(21_600_000L, TimeUnit.MILLISECONDS);
messageBuilder.sendAsync();

What did you expect to see?

The consumer received the message after 21,600,000ms(6 hours).

What did you see instead?

The message was cleared by TTL and the consumer did not receive anything.

Anything else?

On the one hand, I want to confirm whether this is the design, because this is quite counter-intuitive. We generally think that the expiration time is calculated from the delivery time of the message.

If this is expected, then how can I coordinate my TTL configuration along with the sending options.

Are you willing to submit a PR?

  • I'm willing to submit a PR!
@KamenRiderKuuga KamenRiderKuuga added the type/bug The PR fixed a bug or issue reported a bug label Jan 15, 2024
@Technoboy-
Copy link
Contributor

Now the broker side calculate the expire time based on the publishTime of the message.

@KamenRiderKuuga
Copy link
Author

Now the broker side calculate the expire time based on the publishTime of the message.

Then some delayed messages based on days or even months will restrict the TTL configuration, making it difficult to configure a reasonable TTL duration.

@Technoboy-
Copy link
Contributor

Now the broker side calculate the expire time based on the publishTime of the message.

Then some delayed messages based on days or even months will restrict the TTL configuration, making it difficult to configure a reasonable TTL duration.

we will discuss this and work out a good way to handle this case.

@visxu
Copy link
Contributor

visxu commented Dec 16, 2024

@KamenRiderKuuga Well, I think your actual behavior is reasonable, since your message delay time > TTL. Once if send lots of long-long time delayed messages but TTL don't clean up them, the storage will be under great pressure.

BTW, from my case, TTL didn't clean up the delayed message, which is your expectation.
#23739

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug The PR fixed a bug or issue reported a bug
Projects
None yet
Development

No branches or pull requests

3 participants