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

Closing a file has a wasteful preconditions in NameNode

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.9.0, 3.0.0-alpha4, 2.8.2
    • Component/s: namenode
    • Labels:
      None

      Description

      When a file is closed, the NN checks if all the blocks are complete. Instead of a simple 'if (!complete) throw new IllegalState(expensive-err-string)" it invokes "Preconditions.checkStatus(complete, expensive-err-string)". The check is done in a loop for all blocks, so more blocks = more penalty. The expensive string should only be computed when an error actually occurs. A telltale sign is seeing this in a stacktrace:

             at java.lang.Class.getEnclosingMethod0(Native Method)
              at java.lang.Class.getEnclosingMethodInfo(Class.java:1072)
              at java.lang.Class.getEnclosingClass(Class.java:1272)
              at java.lang.Class.getSimpleBinaryName(Class.java:1443)
              at java.lang.Class.getSimpleName(Class.java:1309)
              at org.apache.hadoop.hdfs.server.namenode.INodeFile.assertAllBlocksComplete(INodeFile.java:246)
      

        Activity

        Hide
        ebadger Eric Badger added a comment -

        Uploading patch to get rid of Preconditions and just do the expression checking up front.

        Show
        ebadger Eric Badger added a comment - Uploading patch to get rid of Preconditions and just do the expression checking up front.
        Hide
        liuml07 Mingliang Liu added a comment -

        +1 pending on Jenkins. Thanks Eric.

        Show
        liuml07 Mingliang Liu added a comment - +1 pending on Jenkins. Thanks Eric.
        Hide
        hadoopqa Hadoop QA added a comment -
        -1 overall



        Vote Subsystem Runtime Comment
        0 reexec 0m 17s 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 15m 8s trunk passed
        +1 compile 0m 57s trunk passed
        +1 checkstyle 0m 38s trunk passed
        +1 mvnsite 1m 2s trunk passed
        +1 mvneclipse 0m 14s trunk passed
        +1 findbugs 2m 4s trunk passed
        +1 javadoc 0m 43s trunk passed
        +1 mvninstall 1m 0s the patch passed
        +1 compile 0m 56s the patch passed
        +1 javac 0m 56s the patch passed
        -0 checkstyle 0m 36s hadoop-hdfs-project/hadoop-hdfs: The patch generated 1 new + 21 unchanged - 0 fixed = 22 total (was 21)
        +1 mvnsite 1m 1s the patch passed
        +1 mvneclipse 0m 12s the patch passed
        +1 whitespace 0m 0s The patch has no whitespace issues.
        +1 findbugs 2m 4s the patch passed
        +1 javadoc 0m 37s the patch passed
        -1 unit 69m 0s hadoop-hdfs in the patch failed.
        +1 asflicense 0m 20s The patch does not generate ASF License warnings.
        98m 14s



        Reason Tests
        Failed junit tests hadoop.hdfs.server.namenode.ha.TestDFSUpgradeWithHA
          hadoop.hdfs.server.blockmanagement.TestReconstructStripedBlocksWithRackAwareness
          hadoop.hdfs.TestBlockStoragePolicy
          hadoop.hdfs.server.datanode.TestDataNodeVolumeFailureReporting



        Subsystem Report/Notes
        Docker Image:yetus/hadoop:a9ad5d6
        JIRA Issue HDFS-11592
        JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12861103/HDFS-11592.001.patch
        Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle
        uname Linux 4996831a27f7 3.13.0-107-generic #154-Ubuntu SMP Tue Dec 20 09:57:27 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
        Build tool maven
        Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh
        git revision trunk / 4966a6e
        Default Java 1.8.0_121
        findbugs v3.0.0
        checkstyle https://builds.apache.org/job/PreCommit-HDFS-Build/18897/artifact/patchprocess/diff-checkstyle-hadoop-hdfs-project_hadoop-hdfs.txt
        unit https://builds.apache.org/job/PreCommit-HDFS-Build/18897/artifact/patchprocess/patch-unit-hadoop-hdfs-project_hadoop-hdfs.txt
        Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/18897/testReport/
        modules C: hadoop-hdfs-project/hadoop-hdfs U: hadoop-hdfs-project/hadoop-hdfs
        Console output https://builds.apache.org/job/PreCommit-HDFS-Build/18897/console
        Powered by Apache Yetus 0.5.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 17s 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 15m 8s trunk passed +1 compile 0m 57s trunk passed +1 checkstyle 0m 38s trunk passed +1 mvnsite 1m 2s trunk passed +1 mvneclipse 0m 14s trunk passed +1 findbugs 2m 4s trunk passed +1 javadoc 0m 43s trunk passed +1 mvninstall 1m 0s the patch passed +1 compile 0m 56s the patch passed +1 javac 0m 56s the patch passed -0 checkstyle 0m 36s hadoop-hdfs-project/hadoop-hdfs: The patch generated 1 new + 21 unchanged - 0 fixed = 22 total (was 21) +1 mvnsite 1m 1s the patch passed +1 mvneclipse 0m 12s the patch passed +1 whitespace 0m 0s The patch has no whitespace issues. +1 findbugs 2m 4s the patch passed +1 javadoc 0m 37s the patch passed -1 unit 69m 0s hadoop-hdfs in the patch failed. +1 asflicense 0m 20s The patch does not generate ASF License warnings. 98m 14s Reason Tests Failed junit tests hadoop.hdfs.server.namenode.ha.TestDFSUpgradeWithHA   hadoop.hdfs.server.blockmanagement.TestReconstructStripedBlocksWithRackAwareness   hadoop.hdfs.TestBlockStoragePolicy   hadoop.hdfs.server.datanode.TestDataNodeVolumeFailureReporting Subsystem Report/Notes Docker Image:yetus/hadoop:a9ad5d6 JIRA Issue HDFS-11592 JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12861103/HDFS-11592.001.patch Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle uname Linux 4996831a27f7 3.13.0-107-generic #154-Ubuntu SMP Tue Dec 20 09:57:27 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux Build tool maven Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh git revision trunk / 4966a6e Default Java 1.8.0_121 findbugs v3.0.0 checkstyle https://builds.apache.org/job/PreCommit-HDFS-Build/18897/artifact/patchprocess/diff-checkstyle-hadoop-hdfs-project_hadoop-hdfs.txt unit https://builds.apache.org/job/PreCommit-HDFS-Build/18897/artifact/patchprocess/patch-unit-hadoop-hdfs-project_hadoop-hdfs.txt Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/18897/testReport/ modules C: hadoop-hdfs-project/hadoop-hdfs U: hadoop-hdfs-project/hadoop-hdfs Console output https://builds.apache.org/job/PreCommit-HDFS-Build/18897/console Powered by Apache Yetus 0.5.0-SNAPSHOT http://yetus.apache.org This message was automatically generated.
        Hide
        liuml07 Mingliang Liu added a comment -

        Committed to branch-2.8 through trunk branches. Thanks for your contribution, Eric Badger.

        Show
        liuml07 Mingliang Liu added a comment - Committed to branch-2.8 through trunk branches. Thanks for your contribution, Eric Badger .
        Hide
        ebadger Eric Badger added a comment -

        Thanks, Mingliang Liu!

        Show
        ebadger Eric Badger added a comment - Thanks, Mingliang Liu !
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Jenkins build Hadoop-trunk-Commit #11504 (See https://builds.apache.org/job/Hadoop-trunk-Commit/11504/)
        HDFS-11592. Closing a file has a wasteful preconditions in NameNode. (liuml07: rev e5f0622a6f40706d360d45200c8f259c79046438)

        • (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 #11504 (See https://builds.apache.org/job/Hadoop-trunk-Commit/11504/ ) HDFS-11592 . Closing a file has a wasteful preconditions in NameNode. (liuml07: rev e5f0622a6f40706d360d45200c8f259c79046438) (edit) hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/INodeFile.java
        Hide
        vinodkv Vinod Kumar Vavilapalli added a comment -

        2.8.1 became a security release. Moving fix-version to 2.8.2 after the fact.

        Show
        vinodkv Vinod Kumar Vavilapalli added a comment - 2.8.1 became a security release. Moving fix-version to 2.8.2 after the fact.

          People

          • Assignee:
            ebadger Eric Badger
            Reporter:
            ebadger Eric Badger
          • Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development