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

In BlockManager#rescanPostponedMisreplicatedBlocks(), postponed misreplicated block counts should be retrieved with NN lock protection

    Details

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

      Description

      In BlockManager#rescanPostponedMisreplicatedBlocks(), start and end block counts should be get with the protect with lock. Or, log records like "-1 blocks are removed" which indicate minus blocks are removed could be generated.

      For example, following scenario:
      1. thread1 run long startPostponedMisReplicatedBlocksCount = getPostponedMisreplicatedBlocksCount(); currently startPostponedMisReplicatedBlocksCount get the value 20.
      2. before thread1 run namesystem.writeLock(); , thread2 increment postponedMisreplicatedBlocksCount by 1, so postponedMisreplicatedBlocksCount is 21 now.
      3. thread1 end the iteration, but no postponed block is removed, so after run long endPostponedMisReplicatedBlocksCount = getPostponedMisreplicatedBlocksCount();, endPostponedMisReplicatedBlocksCount get the value of 21.
      4. thread 1 generate the log:

            LOG.info("Rescan of postponedMisreplicatedBlocks completed in " +
                (Time.monotonicNow() - startTimeRescanPostponedMisReplicatedBlocks) +
                " msecs. " + endPostponedMisReplicatedBlocksCount +
                " blocks are left. " + (startPostponedMisReplicatedBlocksCount -
                endPostponedMisReplicatedBlocksCount) + " blocks are removed.");
      

      Then, we'll get the log record like "-1 blocks are removed."

        Activity

        Hide
        hadoopqa Hadoop QA added a comment -
        -1 overall



        Vote Subsystem Runtime Comment
        0 reexec 0m 12s 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 6m 49s trunk passed
        +1 compile 0m 46s trunk passed
        +1 checkstyle 0m 27s trunk passed
        +1 mvnsite 0m 50s trunk passed
        +1 mvneclipse 0m 12s trunk passed
        +1 findbugs 1m 41s trunk passed
        +1 javadoc 0m 55s trunk passed
        +1 mvninstall 0m 45s the patch passed
        +1 compile 0m 40s the patch passed
        +1 javac 0m 40s the patch passed
        +1 checkstyle 0m 24s the patch passed
        +1 mvnsite 0m 47s the patch passed
        +1 mvneclipse 0m 10s the patch passed
        +1 whitespace 0m 0s The patch has no whitespace issues.
        +1 findbugs 1m 45s the patch passed
        +1 javadoc 0m 54s the patch passed
        -1 unit 59m 6s hadoop-hdfs in the patch failed.
        +1 asflicense 0m 17s The patch does not generate ASF License warnings.
        77m 51s



        Reason Tests
        Failed junit tests hadoop.hdfs.server.datanode.TestDataNodeErasureCodingMetrics
          hadoop.hdfs.TestDFSShell
          hadoop.hdfs.server.datanode.TestDirectoryScanner



        Subsystem Report/Notes
        Docker Image:yetus/hadoop:9560f25
        JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12821300/HDFS-10710.1.patch
        JIRA Issue HDFS-10710
        Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle
        uname Linux 04b97c4c9717 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 / 770b5eb
        Default Java 1.8.0_101
        findbugs v3.0.0
        unit https://builds.apache.org/job/PreCommit-HDFS-Build/16276/artifact/patchprocess/patch-unit-hadoop-hdfs-project_hadoop-hdfs.txt
        Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/16276/testReport/
        modules C: hadoop-hdfs-project/hadoop-hdfs U: hadoop-hdfs-project/hadoop-hdfs
        Console output https://builds.apache.org/job/PreCommit-HDFS-Build/16276/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 12s 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 6m 49s trunk passed +1 compile 0m 46s trunk passed +1 checkstyle 0m 27s trunk passed +1 mvnsite 0m 50s trunk passed +1 mvneclipse 0m 12s trunk passed +1 findbugs 1m 41s trunk passed +1 javadoc 0m 55s trunk passed +1 mvninstall 0m 45s the patch passed +1 compile 0m 40s the patch passed +1 javac 0m 40s the patch passed +1 checkstyle 0m 24s the patch passed +1 mvnsite 0m 47s the patch passed +1 mvneclipse 0m 10s the patch passed +1 whitespace 0m 0s The patch has no whitespace issues. +1 findbugs 1m 45s the patch passed +1 javadoc 0m 54s the patch passed -1 unit 59m 6s hadoop-hdfs in the patch failed. +1 asflicense 0m 17s The patch does not generate ASF License warnings. 77m 51s Reason Tests Failed junit tests hadoop.hdfs.server.datanode.TestDataNodeErasureCodingMetrics   hadoop.hdfs.TestDFSShell   hadoop.hdfs.server.datanode.TestDirectoryScanner Subsystem Report/Notes Docker Image:yetus/hadoop:9560f25 JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12821300/HDFS-10710.1.patch JIRA Issue HDFS-10710 Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle uname Linux 04b97c4c9717 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 / 770b5eb Default Java 1.8.0_101 findbugs v3.0.0 unit https://builds.apache.org/job/PreCommit-HDFS-Build/16276/artifact/patchprocess/patch-unit-hadoop-hdfs-project_hadoop-hdfs.txt Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/16276/testReport/ modules C: hadoop-hdfs-project/hadoop-hdfs U: hadoop-hdfs-project/hadoop-hdfs Console output https://builds.apache.org/job/PreCommit-HDFS-Build/16276/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 patch looks good to me. The failed tests should be unrelated: TestDataNodeErasureCodingMetrics and TestDirectoryScanner failed intermittently, they also failed in several other jiras' Jenkins run.

        +1. I will commit the patch shortly.

        Show
        jingzhao Jing Zhao added a comment - The patch looks good to me. The failed tests should be unrelated: TestDataNodeErasureCodingMetrics and TestDirectoryScanner failed intermittently, they also failed in several other jiras' Jenkins run. +1. I will commit the patch shortly.
        Hide
        jingzhao Jing Zhao added a comment -

        I've committed the patch to trunk, branch-2, and branch-2.8. Thanks for the contribution, Rui Gao!

        Show
        jingzhao Jing Zhao added a comment - I've committed the patch to trunk, branch-2, and branch-2.8. Thanks for the contribution, Rui Gao !
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Hadoop-trunk-Commit #10206 (See https://builds.apache.org/job/Hadoop-trunk-Commit/10206/)
        HDFS-10710. In BlockManager#rescanPostponedMisreplicatedBlocks(), (jing9: rev f4ba5ff1d70ef92d59851c09c4bd4b43d6c04971)

        • hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Hadoop-trunk-Commit #10206 (See https://builds.apache.org/job/Hadoop-trunk-Commit/10206/ ) HDFS-10710 . In BlockManager#rescanPostponedMisreplicatedBlocks(), (jing9: rev f4ba5ff1d70ef92d59851c09c4bd4b43d6c04971) hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java
        Hide
        demongaorui Rui Gao added a comment -

        Thanks for your comment and commit, Jing Zhao!

        Show
        demongaorui Rui Gao added a comment - Thanks for your comment and commit, Jing Zhao !

          People

          • Assignee:
            demongaorui Rui Gao
            Reporter:
            demongaorui Rui Gao
          • Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development