You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2023/05/01 11:18:00 UTC

[jira] [Commented] (HADOOP-18723) Add detail logs if distcp checksum mismatch

    [ https://issues.apache.org/jira/browse/HADOOP-18723?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17718202#comment-17718202 ] 

ASF GitHub Bot commented on HADOOP-18723:
-----------------------------------------

steveloughran commented on code in PR #5603:
URL: https://github.com/apache/hadoop/pull/5603#discussion_r1181517673


##########
hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/util/DistCpUtils.java:
##########
@@ -592,10 +592,14 @@ public static CopyMapper.ChecksumComparison checksumsAreEqual(
     // comparison that took place and return not compatible.
     // else if matched, return compatible with the matched result.
     if (sourceChecksum == null || targetChecksum == null) {
+      LOG.error("Checksum incompatible. Source checksum: {}, target checksum: {}",

Review Comment:
   this is not unusual against object stores, as all stores which don't have hdfs-+compatible checksums disable them so that distcp to cloud stores don't blow up. If you logged at error then there'd be an entry for every single copy.
   
   propose: use a LogExactlyOnce at info to day source or target fs doesn't support checksums and that they should use -skipCrc 



##########
hadoop-tools/hadoop-distcp/src/test/java/org/apache/hadoop/tools/mapred/TestCopyCommitter.java:
##########
@@ -569,6 +570,7 @@ private void testCommitWithChecksumMismatch(boolean skipCrc)
                 fs, new Path(sourceBase + srcFilename), null,
                 fs, new Path(targetBase + srcFilename),
                 sourceCurrStatus.getLen()));
+        assertTrue(log.getOutput().contains("Checksum not equal"));

Review Comment:
   asserts to use Assert's assertThat(log.getOutput).contains(...) for better message
   



##########
hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/util/DistCpUtils.java:
##########
@@ -592,10 +592,14 @@ public static CopyMapper.ChecksumComparison checksumsAreEqual(
     // comparison that took place and return not compatible.
     // else if matched, return compatible with the matched result.
     if (sourceChecksum == null || targetChecksum == null) {
+      LOG.error("Checksum incompatible. Source checksum: {}, target checksum: {}",
+          sourceChecksum, targetChecksum);
       return CopyMapper.ChecksumComparison.INCOMPATIBLE;
     } else if (sourceChecksum.equals(targetChecksum)) {
       return CopyMapper.ChecksumComparison.TRUE;
     }
+    LOG.error("Checksum not equal. Source checksum: {}, target checksum: {}",
+        sourceChecksum, targetChecksum);

Review Comment:
   log checksums at debug maybe
   
   anyway, doesn't a checksum mismatch mean "source file needs copying again". so really the thing to log is not the mismatch but why the copy is taking place





> Add detail logs if distcp checksum mismatch
> -------------------------------------------
>
>                 Key: HADOOP-18723
>                 URL: https://issues.apache.org/jira/browse/HADOOP-18723
>             Project: Hadoop Common
>          Issue Type: Improvement
>            Reporter: Janus Chow
>            Assignee: Janus Chow
>            Priority: Major
>              Labels: pull-request-available
>
> We encountered some errors of mismatch checksum during Distcp jobs. It took us some time to figure out that checksum type is different.
> Adding error logs shall help us to figure out such problems faster.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org