eolivelli commented on a change in pull request #11791:
URL: https://github.com/apache/pulsar/pull/11791#discussion_r697158836



##########
File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java
##########
@@ -306,11 +308,38 @@ protected void internalDeleteNamespace(AsyncResponse 
asyncResponse, boolean auth
             }
 
             try {
+                final String globalPartitionedPath = 
path(PARTITIONED_TOPIC_PATH_ZNODE, namespaceName.toString());
+                final String managedLedgerPath = joinPath(MANAGED_LEDGER_ROOT, 
namespaceName.toString());
+                // check whether partitioned topics znode exist
+                if (namespaceResources().exists(globalPartitionedPath)) {
+                    deleteRecursive(namespaceResources(), 
globalPartitionedPath);
+                }
+
+                try {
+                    if (namespaceResources().exists(managedLedgerPath)) {
+                        pulsar().getPulsarResources().getTopicResources()
+                                .clearDomainPersistence(namespaceName).get();
+                        pulsar().getPulsarResources().getTopicResources()
+                                
.clearNamespacePersistence(namespaceName).get();
+                    }
+                } catch (ExecutionException | InterruptedException e) {
+                    // warn level log here since this failure has no side 
effect besides left a un-used metadata

Review comment:
       The case of InterruptedException is to be handled by setting again 
Threwad.currentThread.interrupt()
   I believe we have some utility method for this




-- 
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]


Reply via email to