XbaoWu commented on code in PR #6577:
URL: https://github.com/apache/hadoop/pull/6577#discussion_r1501352665


##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/recovery/ZKRMStateStore.java:
##########
@@ -938,28 +938,36 @@ private void handleApplicationAttemptStateOp(
         attemptStateDataPB.getProto().toByteArray();
     LOG.debug("{} info for attempt: {} at: {}", operation, appAttemptId, path);
 
-    switch (operation) {
-    case UPDATE:
-      if (exists(path)) {
-        zkManager.safeSetData(path, attemptStateData, -1, zkAcl,
-            fencingNodePath);
-      } else {
-        zkManager.safeCreate(path, attemptStateData, zkAcl,
-            CreateMode.PERSISTENT, zkAcl, fencingNodePath);
-        LOG.debug("Path {} for {} didn't exist. Created a new znode to update"
-            + " the application attempt state.", path, appAttemptId);
+    try {
+      switch (operation) {
+      case UPDATE:
+        if (exists(path)) {
+          zkManager.safeSetData(path, attemptStateData, -1, zkAcl,
+              fencingNodePath);
+        } else {
+          zkManager.safeCreate(path, attemptStateData, zkAcl,
+              CreateMode.PERSISTENT, zkAcl, fencingNodePath);
+          LOG.debug("Path {} for {} didn't exist. Created a new znode to 
update"
+              + " the application attempt state.", path, appAttemptId);
 
+        }
+        break;
+      case STORE:
+        zkManager.safeCreate(path, attemptStateData, zkAcl, 
CreateMode.PERSISTENT,
+            zkAcl, fencingNodePath);
+        break;
+      case REMOVE:
+        zkManager.safeDelete(path, zkAcl, fencingNodePath);
+        break;
+      default:
+        break;
+      }
+    } catch (KeeperException.NoNodeException nne){
+      if(!exists(path)){

Review Comment:
   Thank you. I've modified and tested this.



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