소스 검색

HADOOP-17932. Distcp file length comparison have no effect (#3519)

Signed-off-by: Akira Ajisaka <aajisaka@apache.org>
adol001 3 년 전
부모
커밋
280ae1c0a9
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/mapred/RetriableFileCopyCommand.java

+ 1 - 1
hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/mapred/RetriableFileCopyCommand.java

@@ -154,7 +154,7 @@ public class RetriableFileCopyCommand extends RetriableCommand {
       if (!source.isSplit()) {
         DistCpUtils.compareFileLengthsAndChecksums(source.getLen(), sourceFS,
                 sourcePath, sourceChecksum, targetFS,
-                targetPath, skipCrc, source.getLen());
+                targetPath, skipCrc, offset + bytesRead);
       }
       // it's not append or direct write (preferred for s3a) case, thus we first
       // write to a temporary file, then rename it to the target path.