junkaixue commented on code in PR #2759:
URL: https://github.com/apache/helix/pull/2759#discussion_r1491826191


##########
helix-core/src/main/java/org/apache/helix/manager/zk/ZkBaseDataAccessor.java:
##########
@@ -720,11 +720,24 @@ public Stat getStat(String path, int options) {
    */
   @Override
   public boolean remove(String path, int options) {
+    return remove(path, options, -1);
+  }
+
+  /**
+   * Sync remove with expected version. It tries to remove the ZNode if the 
ZNode's version matches
+   * the provided expectedVersion and all its descendants if any. Node does 
not exist is regarded as
+   * success.
+   */
+  @Override
+  public boolean remove(String path, int options, int expectedVersion) {
     try {
       // operation will not throw exception when path successfully deleted or 
does not exist
       // despite real error, operation will throw exception when path not 
empty, and in this
       // case, we try to delete recursively
-      _zkClient.delete(path);
+      _zkClient.delete(path, expectedVersion);

Review Comment:
   NIT: add comment about -1 behavior.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to