Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-10396

Using -diff option with DistCp may get "Comparison method violates its general contract" exception

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.7.4
    • Component/s: None
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      Using -diff option get the following exception due to a bug in the comparison operator:

      16/04/21 14:34:18 WARN tools.DistCp: Failed to use snapshot diff for distcp
      java.lang.IllegalArgumentException: Comparison method violates its general contract!
      	at java.util.TimSort.mergeHi(TimSort.java:868)
      	at java.util.TimSort.mergeAt(TimSort.java:485)
      	at java.util.TimSort.mergeForceCollapse(TimSort.java:426)
      	at java.util.TimSort.sort(TimSort.java:223)
      	at java.util.TimSort.sort(TimSort.java:173)
      	at java.util.Arrays.sort(Arrays.java:659)
      	at org.apache.hadoop.tools.DistCpSync.moveToTarget(DistCpSync.java:293)
      	at org.apache.hadoop.tools.DistCpSync.syncDiff(DistCpSync.java:261)
      	at org.apache.hadoop.tools.DistCpSync.sync(DistCpSync.java:131)
      	at org.apache.hadoop.tools.DistCp.execute(DistCp.java:163)
      	at org.apache.hadoop.tools.DistCp.run(DistCp.java:122)
      	at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
      	at org.apache.hadoop.tools.DistCp.main(DistCp.java:432)
      16/04/21 14:34:18 ERROR tools.DistCp: Exception encountered 
      
      
      1. HDFS-10396.001.patch
        0.8 kB
        Yongjun Zhang

        Activity

        Hide
        yzhangal Yongjun Zhang added a comment -

        I have a fix but need to write a unit test for it.

        Show
        yzhangal Yongjun Zhang added a comment - I have a fix but need to write a unit test for it.
        Hide
        rezaf_2000 Reza Farivar added a comment -

        Yongjun, do you have any updates on this? We are experiencing the same issue in a distcp job.

        Or can you tell us what the cause of this problem was that you were trying to fix?

        Thanks

        Show
        rezaf_2000 Reza Farivar added a comment - Yongjun, do you have any updates on this? We are experiencing the same issue in a distcp job. Or can you tell us what the cause of this problem was that you were trying to fix? Thanks
        Hide
        yzhangal Yongjun Zhang added a comment -

        Sorry Reza Farivar, I was on vacation for some time. Will post a patch soon.

        Show
        yzhangal Yongjun Zhang added a comment - Sorry Reza Farivar , I was on vacation for some time. Will post a patch soon.
        Hide
        yzhangal Yongjun Zhang added a comment -

        Hi Jing Zhao,

        Would you please help taking a look at this quick/small fix? I intended to write a test but we may save the time since this fix is quite obvious.

        Thanks a lot!

        Show
        yzhangal Yongjun Zhang added a comment - Hi Jing Zhao , Would you please help taking a look at this quick/small fix? I intended to write a test but we may save the time since this fix is quite obvious. Thanks a lot!
        Hide
        hadoopqa Hadoop QA added a comment -
        -1 overall



        Vote Subsystem Runtime Comment
        0 reexec 0m 22s Docker mode activated.
        +1 @author 0m 0s The patch does not contain any @author tags.
        -1 test4tests 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
        +1 mvninstall 7m 26s trunk passed
        +1 compile 0m 16s trunk passed
        +1 checkstyle 0m 13s trunk passed
        +1 mvnsite 0m 20s trunk passed
        +1 mvneclipse 0m 13s trunk passed
        +1 findbugs 0m 23s trunk passed
        +1 javadoc 0m 12s trunk passed
        +1 mvninstall 0m 15s the patch passed
        +1 compile 0m 13s the patch passed
        +1 javac 0m 13s the patch passed
        +1 checkstyle 0m 10s the patch passed
        +1 mvnsite 0m 17s the patch passed
        +1 mvneclipse 0m 10s the patch passed
        +1 whitespace 0m 0s The patch has no whitespace issues.
        +1 findbugs 0m 28s the patch passed
        +1 javadoc 0m 9s the patch passed
        +1 unit 9m 15s hadoop-distcp in the patch passed.
        +1 asflicense 0m 14s The patch does not generate ASF License warnings.
        21m 11s



        Subsystem Report/Notes
        Docker Image:yetus/hadoop:85209cc
        JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12813989/HDFS-10396.001.patch
        JIRA Issue HDFS-10396
        Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle
        uname Linux 672c03d96146 3.13.0-36-lowlatency #63-Ubuntu SMP PREEMPT Wed Sep 3 21:56:12 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
        Build tool maven
        Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh
        git revision trunk / 9683eab
        Default Java 1.8.0_91
        findbugs v3.0.0
        Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/15925/testReport/
        modules C: hadoop-tools/hadoop-distcp U: hadoop-tools/hadoop-distcp
        Console output https://builds.apache.org/job/PreCommit-HDFS-Build/15925/console
        Powered by Apache Yetus 0.4.0-SNAPSHOT http://yetus.apache.org

        This message was automatically generated.

        Show
        hadoopqa Hadoop QA added a comment - -1 overall Vote Subsystem Runtime Comment 0 reexec 0m 22s Docker mode activated. +1 @author 0m 0s The patch does not contain any @author tags. -1 test4tests 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch. +1 mvninstall 7m 26s trunk passed +1 compile 0m 16s trunk passed +1 checkstyle 0m 13s trunk passed +1 mvnsite 0m 20s trunk passed +1 mvneclipse 0m 13s trunk passed +1 findbugs 0m 23s trunk passed +1 javadoc 0m 12s trunk passed +1 mvninstall 0m 15s the patch passed +1 compile 0m 13s the patch passed +1 javac 0m 13s the patch passed +1 checkstyle 0m 10s the patch passed +1 mvnsite 0m 17s the patch passed +1 mvneclipse 0m 10s the patch passed +1 whitespace 0m 0s The patch has no whitespace issues. +1 findbugs 0m 28s the patch passed +1 javadoc 0m 9s the patch passed +1 unit 9m 15s hadoop-distcp in the patch passed. +1 asflicense 0m 14s The patch does not generate ASF License warnings. 21m 11s Subsystem Report/Notes Docker Image:yetus/hadoop:85209cc JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12813989/HDFS-10396.001.patch JIRA Issue HDFS-10396 Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle uname Linux 672c03d96146 3.13.0-36-lowlatency #63-Ubuntu SMP PREEMPT Wed Sep 3 21:56:12 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux Build tool maven Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh git revision trunk / 9683eab Default Java 1.8.0_91 findbugs v3.0.0 Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/15925/testReport/ modules C: hadoop-tools/hadoop-distcp U: hadoop-tools/hadoop-distcp Console output https://builds.apache.org/job/PreCommit-HDFS-Build/15925/console Powered by Apache Yetus 0.4.0-SNAPSHOT http://yetus.apache.org This message was automatically generated.
        Hide
        jingzhao Jing Zhao added a comment -

        +1. Thanks for the fix, Yongjun!

        Show
        jingzhao Jing Zhao added a comment - +1. Thanks for the fix, Yongjun!
        Hide
        yzhangal Yongjun Zhang added a comment -

        Thanks a lot Jing Zhao! will commit shortly.

        Show
        yzhangal Yongjun Zhang added a comment - Thanks a lot Jing Zhao ! will commit shortly.
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Hadoop-trunk-Commit #10032 (See https://builds.apache.org/job/Hadoop-trunk-Commit/10032/)
        HDFS-10396. Using -diff option with DistCp may get "Comparison method (yzhang: rev 8113855b3af913e6dcd09626953c64d43168efbd)

        • hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/DiffInfo.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Hadoop-trunk-Commit #10032 (See https://builds.apache.org/job/Hadoop-trunk-Commit/10032/ ) HDFS-10396 . Using -diff option with DistCp may get "Comparison method (yzhang: rev 8113855b3af913e6dcd09626953c64d43168efbd) hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/DiffInfo.java
        Hide
        yzhangal Yongjun Zhang added a comment -

        Committed to trunk, branch-2, branch-2.8, branch-2.7.

        Thanks Jing Zhao for the review and Reza Farivar for the comment.

        Show
        yzhangal Yongjun Zhang added a comment - Committed to trunk, branch-2, branch-2.8, branch-2.7. Thanks Jing Zhao for the review and Reza Farivar for the comment.

          People

          • Assignee:
            yzhangal Yongjun Zhang
            Reporter:
            yzhangal Yongjun Zhang
          • Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development