codelipenghui commented on a change in pull request #8442:
URL: https://github.com/apache/pulsar/pull/8442#discussion_r519501683
##########
File path:
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java
##########
@@ -1783,7 +1785,47 @@ public void checkGC() {
}
return null;
});
+ }
+ }
+
+ private CompletableFuture<Void> deleteZkNode() {
Review comment:
```suggestion
private CompletableFuture<Void> tryToDeletePartitionedMetadata() {
```
##########
File path:
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java
##########
@@ -1783,7 +1785,47 @@ public void checkGC() {
}
return null;
});
+ }
+ }
+
+ private CompletableFuture<Void> deleteZkNode() {
+ if (TopicName.get(topic).isPartitioned() &&
!deletePartitionedTopicMetadataWhileInactive()) {
+ return CompletableFuture.completedFuture(null);
+ }
+ TopicName topicName =
TopicName.get(TopicName.get(topic).getPartitionedTopicName());
+ String path =
AdminResource.path(AdminResource.PARTITIONED_TOPIC_PATH_ZNODE,
topicName.getNamespace()
+ , topicName.getDomain().value(),
topicName.getEncodedLocalName());
+ try {
+ if (topicName.isPartitioned() &&
!getBrokerService().pulsar().getGlobalZkCache().exists(path)) {
+ return CompletableFuture.completedFuture(null);
+ }
+ // make sure all sub partitions were deleted
+ PartitionedTopicMetadata metadata = getBrokerService()
+
.fetchPartitionedTopicMetadataAsync(TopicName.get(topicName.getPartitionedTopicName())).get();
Review comment:
We should get the partitioned metadata asynchronously
----------------------------------------------------------------
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]