diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/backup/master/IncrementalTableBackupProcedure.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/backup/master/IncrementalTableBackupProcedure.java index 6e90309..bad1cf9 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/backup/master/IncrementalTableBackupProcedure.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/backup/master/IncrementalTableBackupProcedure.java @@ -142,29 +142,29 @@ public class IncrementalTableBackupProcedure BackupCopyService.Type.INCREMENTAL, strArr); if (res != 0) { - LOG.error("Copy incremental log files failed with return code: " + res + "."); - throw new IOException("Failed of Hadoop Distributed Copy from "+ - StringUtils.join(incrBackupFileList, ",") +" to " - + backupContext.getHLogTargetDir()); + LOG.error("Copy incremental log files failed with return code: " + res + ". Target dir: " + + backupContext.getHLogTargetDir()); } List missingFiles = getMissingFiles(incrBackupFileList); + LOG.debug("missing files " + StringUtils.join(missingFiles, ",")); - if(missingFiles.isEmpty()) { + if (res == 0 && missingFiles.isEmpty()) { break; - } else { - // Repeat DistCp, some files have been moved from WALs to oldWALs during previous run - // update backupContext and strAttr - if(counter == MAX_ITERAIONS){ - String msg = "DistCp could not finish the following files: " + - StringUtils.join(missingFiles, ","); - LOG.error(msg); - throw new IOException(msg); - } + } + // Repeat DistCp, some files have been moved from WALs to oldWALs during previous run + // update backupContext and strAttr + if(counter == MAX_ITERAIONS){ + String msg = "DistCp could not finish the following files: " + + StringUtils.join(missingFiles, ",") + " to " + backupContext.getHLogTargetDir(); + LOG.error(msg); + throw new IOException(msg); + } + if (!missingFiles.isEmpty()) { List converted = convertFilesFromWALtoOldWAL(missingFiles); incrBackupFileList.removeAll(missingFiles); incrBackupFileList.addAll(converted); backupContext.setIncrBackupFileList(incrBackupFileList); - + // Run DistCp only for missing files (which have been moved from WALs to oldWALs // during previous run) strArr = converted.toArray(new String[converted.size() + 1]);