Pulsar topic auto deletion not work
- Dominant language
- Java
- Stars
- 15.3k
- Forks
- 3.8k
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 160
Description
### Search before asking
- [X] I searched in the [issues](https://github.com/apache/pulsar/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
Version 2.0
### Minimal reproduce step
1.Edit pulsar broker.conf, add the following items:
```markdown
brokerDeleteInactiveTopicsEnabled: true
brokerDeleteInactiveTopicsMode: delete_when_no_subscriptions
brokerDeleteInactiveTopicsMaxInactiveDurationSeconds: 600
```

2. Restart Pulsar broker
3. Add a topic with no subscriptions
4. After 600s, we can still query the topic by using admin API
### What did you expect to see?
The topic can be deleted
### What did you see instead?
The topic still exists
### Anything else?
_No response_
### Are you willing to submit a PR?
- [X] I'm willing to submit a PR!
Contributor guide
Research direction
Start by reproducing the behavior with the broker.conf settings and the no-subscription topic steps, then inspect the broker's inactive-topic deletion path and the admin API result. Confirm whether a topic configured with delete_when_no_subscriptions is removed after 600 seconds, and add regression coverage for the observed behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- distributed-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100