poorbarcode commented on code in PR #17308:
URL: https://github.com/apache/pulsar/pull/17308#discussion_r958734425
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:
##########
@@ -1139,6 +1139,13 @@ private CompletableFuture<Void> delete(boolean
failIfHasSubscriptions,
.map(PersistentSubscription::getName).toList();
return FutureUtil.failedFuture(
new TopicBusyException("Topic has subscriptions did
not catch up: " + backlogSubs));
+ } else if (TopicName.get(topic).isPartitioned()
+ && (getProducers().size() > 0 || getNumberOfConsumers() >
0)
+ && getBrokerService().isAllowAutoTopicCreation(topic)) {
Review Comment:
This PR can not solve every scenario:
The cmd delete topic is executed between these two instructions: `consumer
lookup` and `consumer subscribe`, even if the partitioned topic is deleted
successfully, but the client already has the topic-meta(which has been
deleted), then the consumer subscribes with the topic name "topic-partition-x".
You can reproduce like this:
```
1. create partitioned topic "tp_test"
2. consumer lookup
3. delete topic
4. consumer subscribe
5."tp_test-partition-x" created
```
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]