You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@bookkeeper.apache.org by GitBox <gi...@apache.org> on 2018/01/31 19:13:47 UTC

[GitHub] sijie closed pull request #1073: ZkUtils.asyncDeleteFullPathOptimistic: pass -1 as znodeVersion to parents

sijie closed pull request #1073: ZkUtils.asyncDeleteFullPathOptimistic: pass -1 as znodeVersion to parents
URL: https://github.com/apache/bookkeeper/pull/1073
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/ZkUtils.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/ZkUtils.java
index e03777b1c..5ba4a8554 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/ZkUtils.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/ZkUtils.java
@@ -108,8 +108,7 @@ public void processResult(int rc, String path, Object ctx, String name) {
      * Asynchronously deletes zookeeper path recursively and optimistically.
      * This method is used for deleting the leaf nodes and its corresponding
      * parents if they don't have anymore children after deleting the child
-     * node. For this to work as expected, provided znodeVersion should be -1,
-     * so that there wont be version mismatches with any of the parent nodes. If
+     * node. For deleting the parent nodes it uses -1 as znodeversion. If
      * it fails to delete the leafnode then it will callback with the received
      * error code, but it fails to delete the parent node for whatsoever reason
      * it stops proceeding further and it will callback with ok error code.
@@ -119,7 +118,7 @@ public void processResult(int rc, String path, Object ctx, String name) {
      * @param originalPath
      *            Zookeeper full path
      * @param znodeVersion
-     *            version of the node
+     *            the expected node version of the leafnode
      * @param callback
      *            callback
      * @param leafNodePath
@@ -134,7 +133,7 @@ public static void asyncDeleteFullPathOptimistic(final ZooKeeper zk, final Strin
             public void processResult(int rc, String path, Object ctx) {
                 if (rc == Code.OK.intValue()) {
                     String parent = new File(originalPath).getParent().replace("\\", "/");
-                    asyncDeleteFullPathOptimistic(zk, parent, znodeVersion, callback, leafNodePath);
+                    asyncDeleteFullPathOptimistic(zk, parent, -1, callback, leafNodePath);
                 } else {
                     if (path.equals(leafNodePath)) {
                         callback.processResult(rc, path, leafNodePath);


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services