ArkoSharma commented on a change in pull request #2539:
URL: https://github.com/apache/hive/pull/2539#discussion_r726757597



##########
File path: common/src/java/org/apache/hadoop/hive/common/FileUtils.java
##########
@@ -705,6 +705,16 @@ public static boolean distCpWithSnapshot(String 
oldSnapshot, String newSnapshot,
             oldSnapshot, newSnapshot);
     } catch (IOException e) {
       LOG.error("Can not copy using snapshot from source: {}, target: {}", 
srcPaths, dst);
+      try {
+        // in case overwriteTarget is set to false, and we encounter an 
exception due to targetFs getting
+        // changed since last snapshot, then fallback to initial copy
+        if (!overwriteTarget && !e.getCause().getMessage().contains("changed 
since snapshot")) {
+          LOG.warn("Diff copy failed due to changed target filesystem, falling 
back to normal distcp.");
+          return distCp(srcPaths.get(0).getFileSystem(conf), srcPaths, dst, 
false, proxyUser, conf, shims);

Review comment:
       Done.




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