mehakmeet commented on code in PR #4331:
URL: https://github.com/apache/hadoop/pull/4331#discussion_r900694674


##########
hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsClient.java:
##########
@@ -538,6 +544,23 @@ public Pair<AbfsRestOperation, Boolean> renamePath(
         if (!op.hasResult()) {
           throw e;
         }
+
+        // ref: HADOOP-18242. Rename failure occurring due to a rare case of
+        // tracking metadata being in incomplete state.
+        if (op.getResult().getStorageErrorCode()
+            .equals(RENAME_DESTINATION_PARENT_PATH_NOT_FOUND.getErrorCode())
+            && !hasRetriedRenameOnce) {
+          LOG.info("Rename Failure attempting to resolve tracking metadata "
+              + "state and retrying.");
+
+          // Doing a HEAD call resolves the incomplete metadata state and
+          // then we can retry the rename operation.
+          getPathStatus(source, false, tracingContext);
+          hasRetriedRenameOnce = true;
+          renamePath(source, destination, continuation, tracingContext,
+              sourceEtag);

Review Comment:
   Done. Thanks for pointing it out



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