apache / pulsar

Apache Pulsar - distributed pub-sub messaging system

Home Page:https://pulsar.apache.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug] Partitioned topic deletion by topic GC

mukesh154 opened this issue · comments

Search before asking

  • I searched in the issues and found nothing similar.

Read release policy

  • 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!

it seems not a bug, please see ServiceConfiguration#brokerDeleteInactivePartitionedTopicMetadataEnabled

commented

May not be a bug. Check the broker.conf, this should be true but the default is false.

# Metadata of inactive partitioned topic will not be cleaned up automatically by default.
# Note: If `allowAutoTopicCreation` and this option are enabled at the same time,
# it may appear that a partitioned topic has just been deleted but is automatically created as a non-partitioned topic.
brokerDeleteInactivePartitionedTopicMetadataEnabled=false

It seems to be working with enabling the flag on broker.conf:
brokerDeleteInactivePartitionedTopicMetadataEnabled=true

The same flag is not there on standalone.conf and on adding manually, it is not working as expected.
So, it only works with k8s deployment not on standalone.

Thanks @dao-jun @zzzming