You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/03/25 10:30:47 UTC

[GitHub] [pulsar] poorbarcode commented on a change in pull request #14792: [fix] [package] Fix Auto delete the package name issue

poorbarcode commented on a change in pull request #14792:
URL: https://github.com/apache/pulsar/pull/14792#discussion_r835143360



##########
File path: pulsar-package-management/core/src/main/java/org/apache/pulsar/packages/management/core/impl/PackagesManagementImpl.java
##########
@@ -139,12 +139,30 @@ public void initialize(PackagesStorage storage) {
             .thenCompose(ignore -> storage.writeAsync(packagePath(packageName), inputStream));
     }
 
+    /***
+     * @see {@link PackagesManagement#delete}.
+     * At this implements, there is a problem:
+     *   Concurrently Another command: `create node` when after "getLogs" and before "deleteLog",
+     *   internal implements is recursive-delete, we could not delete every children-nodes
+     * To resolve this problem, I submit a issue&PR to bookkeeper reporitory:
+     *     https://github.com/apache/bookkeeper/issues/3132
+     *     https://github.com/apache/bookkeeper/pull/3133
+     * TODO After the PR merged, change this implements.

Review comment:
       This pr sovle  problem : "dirty zk node". 
   
   But there has one thing not perfect, the case like this: 
   
   User A create a package: "function://public/default/example@v0.1",  then User A want to delete it, so he exec the command "delete function://public/default/example@v0.1"
   
   At the same time, User B want create package "function://public/default/example@v0.2"
   
   If the process running at this line :
   ````
   if (list == null || list.isEmpty()){ 
       return storage.deleteAsync(packageWithoutVersionPath(packageName)); // running at this line
   } else {
       return CompletableFuture.completedFuture(null);
   }
   ````
   delete command will delete `example@v0.2`  also. 
   
   So package module need a api for "delete zk-node only empty",  this PR "https://github.com/apache/bookkeeper/pull/3133" provided 
   
   
   




-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org