diff --git a/hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/mapred/RetriableFileCopyCommand.java b/hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/mapred/RetriableFileCopyCommand.java index 227df08d11..9148630d08 100644 --- a/hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/mapred/RetriableFileCopyCommand.java +++ b/hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/mapred/RetriableFileCopyCommand.java @@ -92,8 +92,9 @@ public class RetriableFileCopyCommand extends RetriableCommand { compareFileLengths(sourceFileStatus, tmpTargetPath, configuration, bytesRead); //At this point, src&dest lengths are same. if length==0, we skip checksum - if (bytesRead != 0) - compareCheckSums(sourceFS, sourceFileStatus.getPath(), targetFS, tmpTargetPath); + if (bytesRead != 0) { + compareCheckSums(sourceFS, sourceFileStatus.getPath(), targetFS, tmpTargetPath); + } promoteTmpToTarget(tmpTargetPath, target, targetFS); return bytesRead;