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

TestBlockReplacement#testThrottler doesn't work as expected

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.7.1
    • Fix Version/s: 2.8.0, 2.7.3, 3.0.0-alpha1
    • Component/s: None
    • Labels:
    • Hadoop Flags:
      Reviewed

      Description

      In TestBlockReplacement#testThrottler, it use a fault variable to calculate the ended bandwidth. It use variable totalBytes rathe than final variable TOTAL_BYTES. And the value of TOTAL_BYTES is set to bytesToSend. The totalBytes looks no meaning here and this will make totalBytes*1000/(end-start) always be 0 and the comparison always true. The method code is below:

      @Test
        public void testThrottler() throws IOException {
          Configuration conf = new HdfsConfiguration();
          FileSystem.setDefaultUri(conf, "hdfs://localhost:0");
          long bandwidthPerSec = 1024*1024L;
          final long TOTAL_BYTES =6*bandwidthPerSec; 
          long bytesToSend = TOTAL_BYTES; 
          long start = Time.monotonicNow();
          DataTransferThrottler throttler = new DataTransferThrottler(bandwidthPerSec);
          long totalBytes = 0L;
          long bytesSent = 1024*512L; // 0.5MB
          throttler.throttle(bytesSent);
          bytesToSend -= bytesSent;
          bytesSent = 1024*768L; // 0.75MB
          throttler.throttle(bytesSent);
          bytesToSend -= bytesSent;
          try {
            Thread.sleep(1000);
          } catch (InterruptedException ignored) {}
          throttler.throttle(bytesToSend);
          long end = Time.monotonicNow();
          assertTrue(totalBytes*1000/(end-start)<=bandwidthPerSec);
        }
      

        Activity

        Hide
        linyiqun Yiqun Lin added a comment -

        Attach a initial patch.

        Show
        linyiqun Yiqun Lin added a comment - Attach a initial patch.
        Hide
        hadoopqa Hadoop QA added a comment -
        -1 overall



        Vote Subsystem Runtime Comment
        0 reexec 0m 10s Docker mode activated.
        +1 @author 0m 0s The patch does not contain any @author tags.
        +1 test4tests 0m 0s The patch appears to include 1 new or modified test files.
        0 mvndep 0m 14s Maven dependency ordering for branch
        +1 mvninstall 6m 25s trunk passed
        +1 compile 0m 37s trunk passed with JDK v1.8.0_66
        +1 compile 0m 40s trunk passed with JDK v1.7.0_91
        +1 checkstyle 0m 20s trunk passed
        +1 mvnsite 0m 50s trunk passed
        +1 mvneclipse 0m 13s trunk passed
        +1 findbugs 1m 51s trunk passed
        +1 javadoc 1m 4s trunk passed with JDK v1.8.0_66
        +1 javadoc 1m 44s trunk passed with JDK v1.7.0_91
        0 mvndep 0m 8s Maven dependency ordering for patch
        +1 mvninstall 0m 43s the patch passed
        +1 compile 0m 35s the patch passed with JDK v1.8.0_66
        +1 javac 0m 35s the patch passed
        +1 compile 0m 38s the patch passed with JDK v1.7.0_91
        +1 javac 0m 38s the patch passed
        +1 checkstyle 0m 17s the patch passed
        +1 mvnsite 0m 47s the patch passed
        +1 mvneclipse 0m 11s the patch passed
        +1 whitespace 0m 0s Patch has no whitespace issues.
        +1 findbugs 2m 4s the patch passed
        +1 javadoc 1m 1s the patch passed with JDK v1.8.0_66
        +1 javadoc 1m 41s the patch passed with JDK v1.7.0_91
        +1 unit 50m 49s hadoop-hdfs in the patch passed with JDK v1.8.0_66.
        -1 unit 49m 49s hadoop-hdfs in the patch failed with JDK v1.7.0_91.
        +1 asflicense 0m 20s Patch does not generate ASF License warnings.
        125m 7s



        Reason Tests
        JDK v1.7.0_91 Failed junit tests hadoop.hdfs.TestDFSUpgradeFromImage



        Subsystem Report/Notes
        Docker Image:yetus/hadoop:0ca8df7
        JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12786651/HDFS.001.patch
        JIRA Issue HDFS-9772
        Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle
        uname Linux 078f8849a01d 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 / cfa8513
        Default Java 1.7.0_91
        Multi-JDK versions /usr/lib/jvm/java-8-oracle:1.8.0_66 /usr/lib/jvm/java-7-openjdk-amd64:1.7.0_91
        findbugs v3.0.0
        unit https://builds.apache.org/job/PreCommit-HDFS-Build/14418/artifact/patchprocess/patch-unit-hadoop-hdfs-project_hadoop-hdfs-jdk1.7.0_91.txt
        unit test logs https://builds.apache.org/job/PreCommit-HDFS-Build/14418/artifact/patchprocess/patch-unit-hadoop-hdfs-project_hadoop-hdfs-jdk1.7.0_91.txt
        JDK v1.7.0_91 Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/14418/testReport/
        modules C: hadoop-hdfs-project/hadoop-hdfs U: hadoop-hdfs-project/hadoop-hdfs
        Max memory used 77MB
        Console output https://builds.apache.org/job/PreCommit-HDFS-Build/14418/console
        Powered by Apache Yetus 0.2.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 10s Docker mode activated. +1 @author 0m 0s The patch does not contain any @author tags. +1 test4tests 0m 0s The patch appears to include 1 new or modified test files. 0 mvndep 0m 14s Maven dependency ordering for branch +1 mvninstall 6m 25s trunk passed +1 compile 0m 37s trunk passed with JDK v1.8.0_66 +1 compile 0m 40s trunk passed with JDK v1.7.0_91 +1 checkstyle 0m 20s trunk passed +1 mvnsite 0m 50s trunk passed +1 mvneclipse 0m 13s trunk passed +1 findbugs 1m 51s trunk passed +1 javadoc 1m 4s trunk passed with JDK v1.8.0_66 +1 javadoc 1m 44s trunk passed with JDK v1.7.0_91 0 mvndep 0m 8s Maven dependency ordering for patch +1 mvninstall 0m 43s the patch passed +1 compile 0m 35s the patch passed with JDK v1.8.0_66 +1 javac 0m 35s the patch passed +1 compile 0m 38s the patch passed with JDK v1.7.0_91 +1 javac 0m 38s the patch passed +1 checkstyle 0m 17s the patch passed +1 mvnsite 0m 47s the patch passed +1 mvneclipse 0m 11s the patch passed +1 whitespace 0m 0s Patch has no whitespace issues. +1 findbugs 2m 4s the patch passed +1 javadoc 1m 1s the patch passed with JDK v1.8.0_66 +1 javadoc 1m 41s the patch passed with JDK v1.7.0_91 +1 unit 50m 49s hadoop-hdfs in the patch passed with JDK v1.8.0_66. -1 unit 49m 49s hadoop-hdfs in the patch failed with JDK v1.7.0_91. +1 asflicense 0m 20s Patch does not generate ASF License warnings. 125m 7s Reason Tests JDK v1.7.0_91 Failed junit tests hadoop.hdfs.TestDFSUpgradeFromImage Subsystem Report/Notes Docker Image:yetus/hadoop:0ca8df7 JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12786651/HDFS.001.patch JIRA Issue HDFS-9772 Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle uname Linux 078f8849a01d 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 / cfa8513 Default Java 1.7.0_91 Multi-JDK versions /usr/lib/jvm/java-8-oracle:1.8.0_66 /usr/lib/jvm/java-7-openjdk-amd64:1.7.0_91 findbugs v3.0.0 unit https://builds.apache.org/job/PreCommit-HDFS-Build/14418/artifact/patchprocess/patch-unit-hadoop-hdfs-project_hadoop-hdfs-jdk1.7.0_91.txt unit test logs https://builds.apache.org/job/PreCommit-HDFS-Build/14418/artifact/patchprocess/patch-unit-hadoop-hdfs-project_hadoop-hdfs-jdk1.7.0_91.txt JDK v1.7.0_91 Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/14418/testReport/ modules C: hadoop-hdfs-project/hadoop-hdfs U: hadoop-hdfs-project/hadoop-hdfs Max memory used 77MB Console output https://builds.apache.org/job/PreCommit-HDFS-Build/14418/console Powered by Apache Yetus 0.2.0-SNAPSHOT http://yetus.apache.org This message was automatically generated.
        Hide
        linyiqun Yiqun Lin added a comment -

        The failed test is not related, thanks review.

        Show
        linyiqun Yiqun Lin added a comment - The failed test is not related, thanks review.
        Hide
        linyiqun Yiqun Lin added a comment -

        hi, Kihwal Lee, could you please review the patch, it seemed that you have modified this method.

        Show
        linyiqun Yiqun Lin added a comment - hi, Kihwal Lee , could you please review the patch, it seemed that you have modified this method.
        Hide
        linyiqun Yiqun Lin added a comment -

        Arun C Murthy, could you please also see this patch, the comparsion code
        totalBytes*1000/(end-start)<=bandwidthPerSec is committed by you, thanks.

        Show
        linyiqun Yiqun Lin added a comment - Arun C Murthy , could you please also see this patch, the comparsion code totalBytes*1000/(end-start)<=bandwidthPerSec is committed by you, thanks.
        Hide
        walter.k.su Walter Su added a comment -

        +1.

        Show
        walter.k.su Walter Su added a comment - +1.
        Hide
        walter.k.su Walter Su added a comment -

        Committed to trunk, branch-2, branch-2.8, branch-2.7. Thanks Yiqun Lin for the contribution.

        Show
        walter.k.su Walter Su added a comment - Committed to trunk, branch-2, branch-2.8, branch-2.7. Thanks Yiqun Lin for the contribution.
        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Hadoop-trunk-Commit #9602 (See https://builds.apache.org/job/Hadoop-trunk-Commit/9602/)
        HDFS-9772. TestBlockReplacement#testThrottler doesn't work as expected. (waltersu4549: rev 903428bf946827b4d58c7c577ed0c574a7cff029)

        • hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestBlockReplacement.java
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Hadoop-trunk-Commit #9602 (See https://builds.apache.org/job/Hadoop-trunk-Commit/9602/ ) HDFS-9772 . TestBlockReplacement#testThrottler doesn't work as expected. (waltersu4549: rev 903428bf946827b4d58c7c577ed0c574a7cff029) hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestBlockReplacement.java
        Hide
        linyiqun Yiqun Lin added a comment -

        Thanks Walter Su for commit!

        Show
        linyiqun Yiqun Lin added a comment - Thanks Walter Su for commit!
        Hide
        vinodkv Vinod Kumar Vavilapalli added a comment -

        Closing the JIRA as part of 2.7.3 release.

        Show
        vinodkv Vinod Kumar Vavilapalli added a comment - Closing the JIRA as part of 2.7.3 release.

          People

          • Assignee:
            linyiqun Yiqun Lin
            Reporter:
            linyiqun Yiqun Lin
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development