Repository: hive
Updated Branches:
  refs/heads/master 5f039a910 -> b38239165


HIVE-20631: Hive returns 20011 error code for re-triable error (Mahesh Kumar 
Behera, reviewed by Sankar Hariappan)


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/b3823916
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/b3823916
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/b3823916

Branch: refs/heads/master
Commit: b382391652ddc210eea055c0b92e3a920813f064
Parents: 5f039a9
Author: Sankar Hariappan <sank...@apache.org>
Authored: Thu Sep 27 14:06:00 2018 +0530
Committer: Sankar Hariappan <sank...@apache.org>
Committed: Thu Sep 27 14:06:00 2018 +0530

----------------------------------------------------------------------
 .../org/apache/hadoop/hive/ql/parse/repl/CopyUtils.java | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/b3823916/ql/src/java/org/apache/hadoop/hive/ql/parse/repl/CopyUtils.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/parse/repl/CopyUtils.java 
b/ql/src/java/org/apache/hadoop/hive/ql/parse/repl/CopyUtils.java
index 461f558..fe0eaf8 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/parse/repl/CopyUtils.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/parse/repl/CopyUtils.java
@@ -212,7 +212,7 @@ public class CopyUtils {
   }
 
   // Check if the source file unmodified even after copy to see if we copied 
the right file
-  private boolean isSourceFileMismatch(FileSystem sourceFs, 
ReplChangeManager.FileInfo srcFile) {
+  private boolean isSourceFileMismatch(FileSystem sourceFs, 
ReplChangeManager.FileInfo srcFile) throws IOException {
     // If source is already CM path, the checksum will be always matching
     if (srcFile.isUseSourcePath()) {
       String sourceChecksumString = srcFile.getCheckSum();
@@ -222,9 +222,13 @@ public class CopyUtils {
           verifySourceChecksumString
                   = ReplChangeManager.checksumFor(srcFile.getSourcePath(), 
sourceFs);
         } catch (IOException e) {
-          // Retry with CM path
-          LOG.debug("Unable to calculate checksum for source file: " + 
srcFile.getSourcePath());
-          return true;
+          LOG.info("Unable to calculate checksum for source file: " + 
srcFile.getSourcePath(), e);
+
+          if (!sourceFs.exists(srcFile.getSourcePath())) {
+            // if source file is missing, then return true, so that cm path 
will be used for copy.
+            return true;
+          }
+          throw e;
         }
         if (!sourceChecksumString.equals(verifySourceChecksumString)) {
           return true;

Reply via email to