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/[email protected]", then
User A want to delete it, so he exec the command "delete
function://public/default/[email protected]"
At the same time, User B want create package
"function://public/default/[email protected]"
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 `[email protected]` 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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]