pulsar icon indicating copy to clipboard operation
pulsar copied to clipboard

[Bug] messageTTL on namespaces doesn't work as expected

Open zymap opened this issue 1 year ago • 0 comments

Search before asking

  • [X] I searched in the issues and found nothing similar.

Read release policy

  • [X] I understand that unsupported versions don't get bug fixes. I will attempt to reproduce the issue on a supported version of Pulsar client and Pulsar broker.

Version

3.1.2. It works fine on the 3.0.x

Minimal reproduce step

  1. Start up standalone
  2. Adjust the ledger rollover settings to make the ledgers switch fast
managedLedgerMaxEntriesPerLedger=500
managedLedgerMinLedgerRolloverTimeMinutes=0
  1. Set the retention policy on the namespace public/default
bin/pulsar-admin namespaces set-retention --size 0 --time 0 public/default
  1. Set the messageTTL on the namespace public/default
bin/pulsar-admin namespaces set-message-ttl public/default -ttl 10s
  1. Produce messages
bin/pulsar-perf produce test -r 100
  1. Consume one message
bin/pulsar-client consume -s sub test -n 1 -sp Earliest
  1. Keep watch the stats-internal
bin/pulsar-admin topics stats-internal test
  1. Because the message expiration check interval is 5min. Set the messageTTL by admin to trigger it immediately
bin/pulsar-admin namespaces set-message-ttl public/default -ttl 10s

What did you expect to see?

The cursor moves forward.

What did you see instead?

The cursor doesn't move.

Anything else?

No response

Are you willing to submit a PR?

  • [ ] I'm willing to submit a PR!

zymap avatar Mar 21 '24 03:03 zymap