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

Expire command affect only one message #732

Open
worekleszczy opened this issue Jun 7, 2022 · 6 comments
Open

Expire command affect only one message #732

worekleszczy opened this issue Jun 7, 2022 · 6 comments

Comments

@worekleszczy
Copy link

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.

@nodece
Copy link
Contributor

nodece commented Jun 11, 2022

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.

@worekleszczy
Copy link
Author

@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.

@nodece
Copy link
Contributor

nodece commented Jun 15, 2022

@zymap Could you take a look this issue?

@nodece
Copy link
Contributor

nodece commented Jun 15, 2022

@worekleszczy Could you provide which you are using the Pulsar version? You can also make an issue in Pulsar.

@worekleszczy
Copy link
Author

@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

@nodece
Copy link
Contributor

nodece commented Jun 15, 2022

Which is the Pulsar version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants