eolivelli commented on code in PR #19374:
URL: https://github.com/apache/pulsar/pull/19374#discussion_r1106771832


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:
##########
@@ -204,23 +208,48 @@ protected CompletableFuture<List<String>> 
internalGetNonPersistentTopics(Policie
                 });
     }
 
-    @SuppressWarnings("unchecked")
-    protected CompletableFuture<Void> internalDeleteNamespaceAsync(boolean 
force) {
+    /**
+     * Delete the namespace and retry to resolve some topics that were not 
created successfully(in metadata)
+     * during the deletion.
+     */
+    protected @Nonnull CompletableFuture<Void> 
internalDeleteNamespaceAsync(boolean force) {
+        final CompletableFuture<Void> future = new CompletableFuture<>();
+        RetryUtil.retryAsynchronously(() -> 
internalDeleteNamespaceAsync0(force),
+                new BackoffBuilder()
+                        .setInitialTime(200, TimeUnit.MILLISECONDS)
+                        .setMandatoryStop(15, TimeUnit.SECONDS)

Review Comment:
   distributed locks are very expensive and in any case you will have to deal 
with timeouts.
   We should make the operations idempotent or chain them.
   if a new operation comes and the deletion is already in progress we must 
wait for the result of the pending operation



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