pulsarctl
pulsarctl copied to clipboard
Expire command affect only one message
Hi,
I'm not sure if this is a bug, but it's definitely confusing me.
Some time age I wanted to manually expire messages for a subscription - I don't have ttl set up for a topic and a service I was manually expiring messages for keep nack
messages due to invalid format, so to prevent this from happen infinitely I run a command:
pulsarctl subscriptions expire my-tenant/my-namespace/some-topic service-subscription-name -t 100
Prior to that I had 40 unacked messages, but after running this I remained with 39. I ended up running this in a loop, but I expected this command to expire all messages that are past expire time
argument. Is this the correct behavior? For a while I thought that -a
it for such use case as mine, but according to #707 it's for something else.
This command should be can expires all messages older than given 100 seconds for service-subscription-name of my-tenant/my-namespace/some-topic topic.
Right now I checked the Pulsarctl codebase, and it seems right to me.
Could you try pulsar-admin topics expire-messages my-tenant/my-namespace/some-topic -t 100 -s service-subscription-name
?
If this command can meet your needs, we will fix the Pulsarctl.
@nodece the command you suggested didn't meet my need - behaviour is exactly the same 🤔
At this point I'm utterly confused - you say that is should expire all messages that are beyond -t
param, but both seem to expire only one message - I checked stats of my topic and had msgBacklog:12
before running it, after I had done it I had msgBacklog: 11
😵 running the command second time has similar effect.
Do you think this might have different outcome depending on type of subscription / TTL settings? I use to to expire
messages for a shared subscription.
@zymap Could you take a look this issue?
@worekleszczy Could you provide which you are using the Pulsar version? You can also make an issue in Pulsar.
@nodece
pulsarctl --version
Release Version: 2.9.2.3
Git Commit Hash: 264c91255ad1eb621c14404799c17a9256c9f6d5
Git Branch: HEAD
UTC Build Time: 2022-02-15 18:14:32
Go Version: go version go1.16.13 linux/amd64
Which is the Pulsar version?