This is an automated email from the ASF dual-hosted git repository.

sijie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git


The following commit(s) were added to refs/heads/master by this push:
     new 02d6f1d  ZkUtils.asyncDeleteFullPathOptimistic: pass -1 as 
znodeVersion to parents
02d6f1d is described below

commit 02d6f1d52484f7d8d1b613f4956193d1ed5b4477
Author: Samuel Just <[email protected]>
AuthorDate: Wed Jan 31 11:13:35 2018 -0800

    ZkUtils.asyncDeleteFullPathOptimistic: pass -1 as znodeVersion to parents
    
    znodeVersion for the child won't necessarily match the parents.  This
    isn't really meaningful to test since the version of the internal nodes
    for all current users will be 0, but fixing it at least will reduce
    confusion
    
    Signed-off-by: Charan Reddy Guttapalem <cguttapalemsalesforce.com>
    [Adapted to current patch]
    Signed-off-by: Samuel Just <sjustsalesforce.com>
    
    Author: Samuel Just <[email protected]>
    
    Reviewers: Jia Zhai <None>, Sijie Guo <[email protected]>
    
    This closes #1073 from athanatos/forupstream/misc/zkutilsfullpath
---
 .../src/main/java/org/apache/bookkeeper/util/ZkUtils.java          | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

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 e03777b..5ba4a85 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 class ZkUtils {
      * 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 class ZkUtils {
      * @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 class ZkUtils {
             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);

-- 
To stop receiving notification emails like this one, please contact
[email protected].

Reply via email to