Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,9 @@ public static CopyMapper.ChecksumComparison checksumsAreEqual(
} else if (sourceChecksum.equals(targetChecksum)) {
return CopyMapper.ChecksumComparison.TRUE;
}
LOG.info("Checksum not equal. Source path: {}, source checksum: {}, target path {}, " +
"target checksum: {}",
source, sourceChecksum, target, targetChecksum);
return CopyMapper.ChecksumComparison.FALSE;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package org.apache.hadoop.tools.mapred;

import org.apache.hadoop.fs.contract.ContractTestUtils;
import org.assertj.core.api.Assertions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.hadoop.conf.Configuration;
Expand Down Expand Up @@ -513,7 +514,8 @@ public void testCommitWithChecksumMismatchWithoutSkipCrc()

private void testCommitWithChecksumMismatch(boolean skipCrc)
throws IOException {

GenericTestUtils.LogCapturer log = GenericTestUtils.LogCapturer.captureLogs(
LoggerFactory.getLogger(DistCpUtils.class));
TaskAttemptContext taskAttemptContext = getTaskAttemptContext(config);
JobContext jobContext = new JobContextImpl(
taskAttemptContext.getConfiguration(),
Expand Down Expand Up @@ -569,6 +571,7 @@ private void testCommitWithChecksumMismatch(boolean skipCrc)
fs, new Path(sourceBase + srcFilename), null,
fs, new Path(targetBase + srcFilename),
sourceCurrStatus.getLen()));
Assertions.assertThat(log.getOutput()).contains("Checksum not equal");
} catch(IOException exception) {
if (skipCrc) {
LOG.error("Unexpected exception is found", exception);
Expand Down