apache / pulsar

Apache Pulsar - distributed pub-sub messaging system
https://pulsar.apache.org/
Apache License 2.0
14.25k stars 3.58k forks source link

Pulsar topic auto deletion not work #22717

Open river1017 opened 6 months ago

river1017 commented 6 months ago

Search before asking

Read release policy

Version

Version 2.0

Minimal reproduce step

1.Edit pulsar broker.conf, add the following items:

brokerDeleteInactiveTopicsEnabled: true
brokerDeleteInactiveTopicsMode: delete_when_no_subscriptions
brokerDeleteInactiveTopicsMaxInactiveDurationSeconds: 600

aaa

  1. Restart Pulsar broker

  2. Add a topic with no subscriptions

  3. 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?

lhotari commented 6 months ago

Please report in English. @river1017 would you be able to translate the issue report? thanks

dao-jun commented 6 months ago

Please report in English. @river1017 would you be able to translate the issue report? thanks

@lhotari I translated it

dao-jun commented 6 months ago

it seems not an issue, try set brokerDeleteInactivePartitionedTopicMetadataEnabled to true

river1017 commented 5 months ago

it seems not an issue, try set brokerDeleteInactivePartitionedTopicMetadataEnabled to true

Thanks for the answer, but I set brokerDeleteInactivePartitionedTopicMetadataEnabled and then restarted pulsar but it doesn't seem to work.Ten minutes after restarting, I could still get the topic without subscribers from the interface. 1716126757762

lhotari commented 5 months ago

There's a limitation in the deleting inactive topics when it comes to completely unused topics. If the namespace bundle of the topic isn't active, the topics won't get deleted.