From 280ae1c0a9e156b832fb4e3ddd90faafa6477802 Mon Sep 17 00:00:00 2001 From: adol001 <465136922@qq.com> Date: Mon, 18 Oct 2021 18:07:53 +0800 Subject: [PATCH] HADOOP-17932. Distcp file length comparison have no effect (#3519) Signed-off-by: Akira Ajisaka --- .../apache/hadoop/tools/mapred/RetriableFileCopyCommand.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 e836ccce41..544dbfbc4c 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 @@ -154,7 +154,7 @@ private long doCopy(CopyListingFileStatus source, Path target, 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.