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

dfsadmin shows DFS Used%: NaN% if the cluster has zero block.

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.9.0, 3.0.0-beta1
    • Component/s: None
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      This is rather a non-issue, but thought I should file it anyway.

      I have a test cluster with just NN fsimage, no DN, no blocks, and dfsadmin shows:

      $ hdfs dfsadmin -report
      Configured Capacity: 0 (0 B)
      Present Capacity: 0 (0 B)
      DFS Remaining: 0 (0 B)
      DFS Used: 0 (0 B)
      DFS Used%: NaN%
      

        Activity

        Hide
        cheersyang Weiwei Yang added a comment -

        Hi Wei-Chiu Chuang

        I did a quick check. NaN was from 0/(double)0, if presentCapacity is 0, it should directly return 0, instead of letting it divide by zero. Let me submit a simple patch for this.

        Show
        cheersyang Weiwei Yang added a comment - Hi Wei-Chiu Chuang I did a quick check. NaN was from 0/(double)0 , if presentCapacity is 0, it should directly return 0, instead of letting it divide by zero. Let me submit a simple patch for this.
        Hide
        hadoopqa Hadoop QA added a comment -
        -1 overall



        Vote Subsystem Runtime Comment
        0 reexec 0m 18s Docker mode activated.
              Prechecks
        +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.
              trunk Compile Tests
        +1 mvninstall 15m 19s trunk passed
        +1 compile 0m 57s trunk passed
        +1 checkstyle 0m 42s trunk passed
        +1 mvnsite 1m 4s trunk passed
        -1 findbugs 1m 55s hadoop-hdfs-project/hadoop-hdfs in trunk has 10 extant Findbugs warnings.
        +1 javadoc 0m 44s trunk passed
              Patch Compile Tests
        +1 mvninstall 1m 0s the patch passed
        +1 compile 0m 56s the patch passed
        +1 javac 0m 56s the patch passed
        +1 checkstyle 0m 41s the patch passed
        +1 mvnsite 1m 0s the patch passed
        +1 whitespace 0m 0s The patch has no whitespace issues.
        +1 findbugs 2m 3s the patch passed
        +1 javadoc 0m 41s the patch passed
              Other Tests
        -1 unit 68m 53s hadoop-hdfs in the patch failed.
        +1 asflicense 0m 20s The patch does not generate ASF License warnings.
        98m 1s



        Reason Tests
        Failed junit tests hadoop.hdfs.TestDFSStripedOutputStreamWithFailure150
          hadoop.hdfs.TestDFSStripedOutputStreamWithFailureWithRandomECPolicy
          hadoop.hdfs.TestDFSStripedOutputStreamWithFailure080
          hadoop.hdfs.server.namenode.ha.TestDFSUpgradeWithHA



        Subsystem Report/Notes
        Docker Image:yetus/hadoop:14b5c93
        JIRA Issue HDFS-12176
        JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12878292/HDFS-12176.001.patch
        Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle
        uname Linux d2ae020fa6da 3.13.0-116-generic #163-Ubuntu SMP Fri Mar 31 14:13:22 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
        Build tool maven
        Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh
        git revision trunk / 44350fd
        Default Java 1.8.0_131
        findbugs v3.1.0-RC1
        findbugs https://builds.apache.org/job/PreCommit-HDFS-Build/20365/artifact/patchprocess/branch-findbugs-hadoop-hdfs-project_hadoop-hdfs-warnings.html
        unit https://builds.apache.org/job/PreCommit-HDFS-Build/20365/artifact/patchprocess/patch-unit-hadoop-hdfs-project_hadoop-hdfs.txt
        Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/20365/testReport/
        modules C: hadoop-hdfs-project/hadoop-hdfs U: hadoop-hdfs-project/hadoop-hdfs
        Console output https://builds.apache.org/job/PreCommit-HDFS-Build/20365/console
        Powered by Apache Yetus 0.6.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 18s Docker mode activated.       Prechecks +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.       trunk Compile Tests +1 mvninstall 15m 19s trunk passed +1 compile 0m 57s trunk passed +1 checkstyle 0m 42s trunk passed +1 mvnsite 1m 4s trunk passed -1 findbugs 1m 55s hadoop-hdfs-project/hadoop-hdfs in trunk has 10 extant Findbugs warnings. +1 javadoc 0m 44s trunk passed       Patch Compile Tests +1 mvninstall 1m 0s the patch passed +1 compile 0m 56s the patch passed +1 javac 0m 56s the patch passed +1 checkstyle 0m 41s the patch passed +1 mvnsite 1m 0s the patch passed +1 whitespace 0m 0s The patch has no whitespace issues. +1 findbugs 2m 3s the patch passed +1 javadoc 0m 41s the patch passed       Other Tests -1 unit 68m 53s hadoop-hdfs in the patch failed. +1 asflicense 0m 20s The patch does not generate ASF License warnings. 98m 1s Reason Tests Failed junit tests hadoop.hdfs.TestDFSStripedOutputStreamWithFailure150   hadoop.hdfs.TestDFSStripedOutputStreamWithFailureWithRandomECPolicy   hadoop.hdfs.TestDFSStripedOutputStreamWithFailure080   hadoop.hdfs.server.namenode.ha.TestDFSUpgradeWithHA Subsystem Report/Notes Docker Image:yetus/hadoop:14b5c93 JIRA Issue HDFS-12176 JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12878292/HDFS-12176.001.patch Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle uname Linux d2ae020fa6da 3.13.0-116-generic #163-Ubuntu SMP Fri Mar 31 14:13:22 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux Build tool maven Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh git revision trunk / 44350fd Default Java 1.8.0_131 findbugs v3.1.0-RC1 findbugs https://builds.apache.org/job/PreCommit-HDFS-Build/20365/artifact/patchprocess/branch-findbugs-hadoop-hdfs-project_hadoop-hdfs-warnings.html unit https://builds.apache.org/job/PreCommit-HDFS-Build/20365/artifact/patchprocess/patch-unit-hadoop-hdfs-project_hadoop-hdfs.txt Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/20365/testReport/ modules C: hadoop-hdfs-project/hadoop-hdfs U: hadoop-hdfs-project/hadoop-hdfs Console output https://builds.apache.org/job/PreCommit-HDFS-Build/20365/console Powered by Apache Yetus 0.6.0-SNAPSHOT http://yetus.apache.org This message was automatically generated.
        Hide
        hanishakoneru Hanisha Koneru added a comment -

        Thanks for the patch Weiwei Yang. The patch LGTM.
        Findbug and unit test errors are unrelated.
        Tested the change.
        +1 (non-binding)

        Show
        hanishakoneru Hanisha Koneru added a comment - Thanks for the patch Weiwei Yang . The patch LGTM. Findbug and unit test errors are unrelated. Tested the change. +1 (non-binding)
        Hide
        cheersyang Weiwei Yang added a comment -

        Thanks Harsha Koneru for the review.
        Hi Wei-Chiu Chuang, does the change look good to you?

        Show
        cheersyang Weiwei Yang added a comment - Thanks Harsha Koneru for the review. Hi Wei-Chiu Chuang , does the change look good to you?
        Hide
        jojochuang Wei-Chiu Chuang added a comment -

        +1

        Show
        jojochuang Wei-Chiu Chuang added a comment - +1
        Hide
        jojochuang Wei-Chiu Chuang added a comment -

        Wanted to commit the patch, but there's a mvn compilation issue (looks like HADOOP-14677).

        I will be off the following few days so I'll commit the patch when I am back on line (or someone else can commit for me )

        Show
        jojochuang Wei-Chiu Chuang added a comment - Wanted to commit the patch, but there's a mvn compilation issue (looks like HADOOP-14677 ). I will be off the following few days so I'll commit the patch when I am back on line (or someone else can commit for me )
        Hide
        ajisakaa Akira Ajisaka added a comment -

        +1, checking this in.

        Show
        ajisakaa Akira Ajisaka added a comment - +1, checking this in.
        Hide
        ajisakaa Akira Ajisaka added a comment -

        Committed this to trunk and branch-2. Thanks Weiwei Yang for the contribution and thanks Hanisha Koneru and Wei-Chiu Chuang for the review.

        Show
        ajisakaa Akira Ajisaka added a comment - Committed this to trunk and branch-2. Thanks Weiwei Yang for the contribution and thanks Hanisha Koneru and Wei-Chiu Chuang for the review.
        Hide
        cheersyang Weiwei Yang added a comment -

        Thank you Akira Ajisaka!

        Show
        cheersyang Weiwei Yang added a comment - Thank you Akira Ajisaka !
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Jenkins build Hadoop-trunk-Commit #12048 (See https://builds.apache.org/job/Hadoop-trunk-Commit/12048/)
        HDFS-12176. dfsadmin shows DFS Used%: NaN% if the cluster has zero (aajisaka: rev 770cc462281518545e3d1c0f8c21cf9ec9673200)

        • (edit) hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/DFSAdmin.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Jenkins build Hadoop-trunk-Commit #12048 (See https://builds.apache.org/job/Hadoop-trunk-Commit/12048/ ) HDFS-12176 . dfsadmin shows DFS Used%: NaN% if the cluster has zero (aajisaka: rev 770cc462281518545e3d1c0f8c21cf9ec9673200) (edit) hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/DFSAdmin.java

          People

          • Assignee:
            cheersyang Weiwei Yang
            Reporter:
            jojochuang Wei-Chiu Chuang
          • Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development