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

Fix INodeFile#getBlocks to not return null

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.0-alpha2
    • Fix Version/s: 2.8.0, 3.0.0-alpha1
    • Component/s: namenode
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      Not all callers of INodeFile#getBlocks check for null. e.g.

        public final QuotaCounts storagespaceConsumedContiguous(
            BlockStoragePolicy bsp) {
      ...
            // Collect all distinct blocks
            Set<BlockInfo> allBlocks = new HashSet<>(Arrays.asList(getBlocks()));
      

      We can either fix each caller or alternatively fix getBlocks to never return null.

        Activity

        Hide
        arpitagarwal Arpit Agarwal added a comment - - edited

        v01 patch avoids setting INodeFile#blocks to null.

        Thanks to Jing Zhao for taking a look at an earlier version of this change offline!

        Show
        arpitagarwal Arpit Agarwal added a comment - - edited v01 patch avoids setting INodeFile#blocks to null. Thanks to Jing Zhao for taking a look at an earlier version of this change offline!
        Hide
        jingzhao Jing Zhao added a comment -

        The patch looks good to me. +1 pending Jenkins.

        Show
        jingzhao Jing Zhao added a comment - The patch looks good to me. +1 pending Jenkins.
        Hide
        hadoopqa Hadoop QA added a comment -
        -1 overall



        Vote Subsystem Runtime Comment
        0 reexec 0m 15s 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 12s trunk passed
        +1 compile 0m 46s trunk passed
        +1 checkstyle 0m 27s trunk passed
        +1 mvnsite 0m 52s trunk passed
        +1 mvneclipse 0m 13s trunk passed
        +1 findbugs 1m 46s trunk passed
        +1 javadoc 0m 54s trunk passed
        +1 mvninstall 0m 45s the patch passed
        +1 compile 0m 42s the patch passed
        +1 javac 0m 42s the patch passed
        +1 checkstyle 0m 22s the patch passed
        +1 mvnsite 0m 48s the patch passed
        +1 mvneclipse 0m 9s the patch passed
        +1 whitespace 0m 1s The patch has no whitespace issues.
        +1 findbugs 1m 45s the patch passed
        +1 javadoc 0m 51s the patch passed
        -1 unit 57m 32s hadoop-hdfs in the patch failed.
        +1 asflicense 0m 18s The patch does not generate ASF License warnings.
        76m 48s



        Reason Tests
        Failed junit tests hadoop.hdfs.server.namenode.ha.TestBootstrapStandby
          hadoop.hdfs.server.namenode.ha.TestSeveralNameNodes



        Subsystem Report/Notes
        Docker Image:yetus/hadoop:9560f25
        JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12823775/HDFS-10764.01.patch
        JIRA Issue HDFS-10764
        Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle
        uname Linux ca64cda4cd8b 3.13.0-92-generic #139-Ubuntu SMP Tue Jun 28 20:42:26 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
        Build tool maven
        Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh
        git revision trunk / b427ce1
        Default Java 1.8.0_101
        findbugs v3.0.0
        unit https://builds.apache.org/job/PreCommit-HDFS-Build/16441/artifact/patchprocess/patch-unit-hadoop-hdfs-project_hadoop-hdfs.txt
        Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/16441/testReport/
        modules C: hadoop-hdfs-project/hadoop-hdfs U: hadoop-hdfs-project/hadoop-hdfs
        Console output https://builds.apache.org/job/PreCommit-HDFS-Build/16441/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 15s 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 12s trunk passed +1 compile 0m 46s trunk passed +1 checkstyle 0m 27s trunk passed +1 mvnsite 0m 52s trunk passed +1 mvneclipse 0m 13s trunk passed +1 findbugs 1m 46s trunk passed +1 javadoc 0m 54s trunk passed +1 mvninstall 0m 45s the patch passed +1 compile 0m 42s the patch passed +1 javac 0m 42s the patch passed +1 checkstyle 0m 22s the patch passed +1 mvnsite 0m 48s the patch passed +1 mvneclipse 0m 9s the patch passed +1 whitespace 0m 1s The patch has no whitespace issues. +1 findbugs 1m 45s the patch passed +1 javadoc 0m 51s the patch passed -1 unit 57m 32s hadoop-hdfs in the patch failed. +1 asflicense 0m 18s The patch does not generate ASF License warnings. 76m 48s Reason Tests Failed junit tests hadoop.hdfs.server.namenode.ha.TestBootstrapStandby   hadoop.hdfs.server.namenode.ha.TestSeveralNameNodes Subsystem Report/Notes Docker Image:yetus/hadoop:9560f25 JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12823775/HDFS-10764.01.patch JIRA Issue HDFS-10764 Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle uname Linux ca64cda4cd8b 3.13.0-92-generic #139-Ubuntu SMP Tue Jun 28 20:42:26 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux Build tool maven Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh git revision trunk / b427ce1 Default Java 1.8.0_101 findbugs v3.0.0 unit https://builds.apache.org/job/PreCommit-HDFS-Build/16441/artifact/patchprocess/patch-unit-hadoop-hdfs-project_hadoop-hdfs.txt Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/16441/testReport/ modules C: hadoop-hdfs-project/hadoop-hdfs U: hadoop-hdfs-project/hadoop-hdfs Console output https://builds.apache.org/job/PreCommit-HDFS-Build/16441/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 -

        The failed tests should be unrelated. I've committed the patch to trunk, branch-2, and branch-2.8.

        Show
        jingzhao Jing Zhao added a comment - The failed tests should be unrelated. I've committed the patch to trunk, branch-2, and branch-2.8.
        Hide
        jingzhao Jing Zhao added a comment -

        And thanks a lot for the contribution, Arpit Agarwal!

        Show
        jingzhao Jing Zhao added a comment - And thanks a lot for the contribution, Arpit Agarwal !
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Jenkins build Hadoop-trunk-Commit #10315 (See https://builds.apache.org/job/Hadoop-trunk-Commit/10315/)
        HDFS-10764. Fix INodeFile#getBlocks to not return null. Contributed by (jing9: rev 0faee62a0c8c1b8fd83227babfd00fbc2b26bddf)

        • (edit) hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/INodeFile.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Jenkins build Hadoop-trunk-Commit #10315 (See https://builds.apache.org/job/Hadoop-trunk-Commit/10315/ ) HDFS-10764 . Fix INodeFile#getBlocks to not return null. Contributed by (jing9: rev 0faee62a0c8c1b8fd83227babfd00fbc2b26bddf) (edit) hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/INodeFile.java

          People

          • Assignee:
            arpitagarwal Arpit Agarwal
            Reporter:
            arpitagarwal Arpit Agarwal
          • Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development