heronr opened a new issue #8243:
URL: https://github.com/apache/pulsar/issues/8243


   **Describe the bug**
   When the broker is configured to delete inactive topics, only 
non-partitioned topics are deleted. This includes the non-partitioned 
_"partition-[number]"_ topics that make up the implementation of partitioned 
topics.
   
   **To Reproduce**
   1. Configure the broker to delete inactive topics: 
**brokerDeleteInactiveTopicsEnabled=true**
   1. You can also increase the frequency to make this easier to reproduce: 
**brokerDeleteInactiveTopicsFrequencySeconds=5**
   1. Using the admin api, create a partitioned topic _foo_
   1. Using the admin api, list partitioned topics and non-partitioned topics. 
You should see the _foo_ partitioned topic and the _foo-partition-0_, etc. 
topics
   1. Using a test client or the pulsar-admin cli, create a subscription: 
**pulsar-admin topics create-subscription -s foo_sub foo**
   1. Unsubscribe from the just created subscription: **pulsar-admin topics 
unsubscribe -s foo_sub foo**
   1. Wait for the non-partitioned topics to be deleted due to inactivity. 
   1. The partitioned topic will remain but all the non-partitioned topics will 
be deleted.
   
   **Expected behavior**
   I expect for the partitioned topic to be deleted due to inactivity along 
with the non-partitioned topics. I also expect for the inactivity to be based 
on the activity level of the partitioned topic and not of the non-partitioned 
topics. 
   
   **Desktop
    - OS: Linux, Windows using pulsar-client-cpp
   
   **Additional context**
   We discovered this because we disabled auto-topic creation and have our 
services themselves create all necessary topics through the admin-api. We 
noticed that with partitioned topics we would get into an unrecoverable state 
because on subsequent runs, the call to create a partitioned topic with a well 
known name would return 409 or that the topic already exists. However, creating 
a producer or subscribing to the partitioned topic would fail, because the 
underlying _partition-[number]_ topics will have been deleted due to 
inactivity. 
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to