[Bug] Partitioned topic deletion by topic GC
- 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
3.1.2
### Minimal reproduce step
- Fire up a Pulsar cluster with the "inactive delete" options enabled:
```
brokerDeleteInactiveTopicsEnabled=true
brokerDeleteInactiveTopicsFrequencySeconds=60
brokerDeleteInactiveTopicsMode=delete_when_no_subscriptions
```
- Create a namespace with inactive topic policy deleted after 60 seconds. This is a default behaviour.
- Create a partitioned topic via pulsar-admin
- Produce a few messages to the partitioned topic. Do not create any subscription
- Check after a few minutes to make sure if the partitions are deleted or not and check the partitioned topic self still there or not.
### What did you expect to see?
The topic should be deleted along with the partitions because they weren't being used.
### What did you see instead?
The topic is never cleaned up only partitions are deleted. If you list the topics with the pulsar-admin tool the topic won't be listed, but when you try to create another topic with the same name it will say topic already exists.
### Anything else?
_No response_
### Are you willing to submit a PR?
- [ ] I'm willing to submit a PR!
Contributor guide
Research direction
Start by reproducing the issue with the brokerDeleteInactiveTopics settings and the pulsar-admin partitioned-topic workflow described in the report. Trace topic GC for the partitioned topic and its partitions; done means both the parent topic and partitions are removed, and the same topic name can be created again.
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