huizhilu commented on a change in pull request #1812:
URL: https://github.com/apache/helix/pull/1812#discussion_r667395863



##########
File path: 
helix-core/src/main/java/org/apache/helix/manager/zk/ParticipantManager.java
##########
@@ -413,13 +452,16 @@ private void carryOverPreviousCurrentState() {
      * remove previous current state parent nodes
      */
     for (String session : sessions) {
-      if (session.equals(_sessionId)) {
+      if (session.equals(sessionId)) {
         continue;
       }
 
-      String path = _keyBuilder.currentStates(_instanceName, 
session).getPath();
-      LOG.info("Removing current states from previous sessions. path: " + 
path);
-      _zkclient.deleteRecursively(path);
+      PropertyKey currentStatesProperty = 
keyBuilder.currentStates(instanceName, session);
+      String path = currentStatesProperty.getPath();
+      LOG.info("Removing current states from previous sessions. path: {}", 
path);
+      if (!dataAccessor.removeProperty(currentStatesProperty)) {
+        throw new ZkClientException("Failed to delete " + path);

Review comment:
       The original `_zkclient.deleteRecursively(path);` also throws 
ZkClientException if failed. So the exception is added to keep the logic 
without any change.




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