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

NameNode exits due to setting BlockPlacementPolicy loglevel to Debug

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.8.1
    • Fix Version/s: 2.7.4, 2.8.2
    • Component/s: block placement
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      NameNode exits because the ReplicationMonitor thread internally throws NPE.
      The reason for throwing NPE is that the builder field is not initialized whe do log.
      Solution: before appending it should determine whether the builder is null

      if (LOG.isDebugEnabled()) {
        builder = debugLoggingBuilder.get();
        builder.setLength(0);
        builder.append("[");
      }
      some other codes ...
      if (LOG.isDebugEnabled()) {
        builder.append("\nNode ").append(NodeBase.getPath(chosenNode))
            .append(" [");
      }
      some other codes ...
      if (LOG.isDebugEnabled()) {
        builder.append("\n]");
      }
      

      NN exception log is :

      java.lang.NullPointerException
              at org.apache.hadoop.hdfs.server.blockmanagement.BlockPlacementPolicyDefault.chooseRandom(BlockPlacementPolicyDefault.java:722)
              at org.apache.hadoop.hdfs.server.blockmanagement.BlockPlacementPolicyDefault.chooseRandom(BlockPlacementPolicyDefault.java:689)
              at org.apache.hadoop.hdfs.server.blockmanagement.BlockPlacementPolicyDefault.chooseFromNextRack(BlockPlacementPolicyDefault.java:640)
              at org.apache.hadoop.hdfs.server.blockmanagement.BlockPlacementPolicyDefault.chooseLocalRack(BlockPlacementPolicyDefault.java:608)
              at org.apache.hadoop.hdfs.server.blockmanagement.BlockPlacementPolicyDefault.chooseTargetInOrder(BlockPlacementPolicyDefault.java:483)
              at org.apache.hadoop.hdfs.server.blockmanagement.BlockPlacementPolicyDefault.chooseTarget(BlockPlacementPolicyDefault.java:390)
              at org.apache.hadoop.hdfs.server.blockmanagement.BlockPlacementPolicyDefault.chooseTarget(BlockPlacementPolicyDefault.java:419)
              at org.apache.hadoop.hdfs.server.blockmanagement.BlockPlacementPolicyDefault.chooseTarget(BlockPlacementPolicyDefault.java:266)
              at org.apache.hadoop.hdfs.server.blockmanagement.BlockPlacementPolicyDefault.chooseTarget(BlockPlacementPolicyDefault.java:119)
              at org.apache.hadoop.hdfs.server.blockmanagement.ReplicationWork.chooseTargets(ReplicationWork.java:55)
              at org.apache.hadoop.hdfs.server.blockmanagement.BlockManager.computeReplicationWorkForBlocks(BlockManager.java:1532)
              at org.apache.hadoop.hdfs.server.blockmanagement.BlockManager.computeReplicationWork(BlockManager.java:1491)
              at org.apache.hadoop.hdfs.server.blockmanagement.BlockManager.computeDatanodeWork(BlockManager.java:3768)
              at org.apache.hadoop.hdfs.server.blockmanagement.BlockManager$ReplicationMonitor.run(BlockManager.java:3720)
              at java.lang.Thread.run(Thread.java:834)
      
      
      1. HDFS_9668_1.patch
        1 kB
        Jiandan Yang
      2. HDFS-12177-001-branch-2.7.patch
        1 kB
        Jiandan Yang
      3. HDFS-12177-001-branch-2.8.patch
        1 kB
        Jiandan Yang
      4. HDFS-12177-branch-2.7-001-.patch
        1 kB
        Brahma Reddy Battula
      5. HDFS-12177-branch-2.8-001.patch
        1 kB
        Brahma Reddy Battula

        Issue Links

          Activity

          Hide
          brahmareddy Brahma Reddy Battula added a comment - - edited

          Jiandan Yang thanks for reporting this..it's dupe of HDFS-11827. but it's committed to only branch-2 and trunk. Since we had given the 3.0.0-alpha4 release, we can't cherry-pick HDFS-11827 so We can target this branch-2.8 and branch-2.7 as part of this.

          Show
          brahmareddy Brahma Reddy Battula added a comment - - edited Jiandan Yang thanks for reporting this..it's dupe of HDFS-11827 . but it's committed to only branch-2 and trunk . Since we had given the 3.0.0-alpha4 release, we can't cherry-pick HDFS-11827 so We can target this branch-2.8 and branch-2.7 as part of this.
          Hide
          brahmareddy Brahma Reddy Battula added a comment -

          Jiandan Yang added you as HDFS contributor and assigned this issue to you.Now on wards, you can assign issues yourself.

          Please have look at following to know more about contribution.

          https://cwiki.apache.org/confluence/display/HADOOP/HowToContribute

          Patch LGTM.

          Show
          brahmareddy Brahma Reddy Battula added a comment - Jiandan Yang added you as HDFS contributor and assigned this issue to you.Now on wards, you can assign issues yourself. Please have look at following to know more about contribution. https://cwiki.apache.org/confluence/display/HADOOP/HowToContribute Patch LGTM.
          Hide
          yangjiandan Jiandan Yang added a comment -

          Brahma Reddy Battula Thanks for your quick response

          Show
          yangjiandan Jiandan Yang added a comment - Brahma Reddy Battula Thanks for your quick response
          Hide
          hadoopqa Hadoop QA added a comment -
          -1 overall



          Vote Subsystem Runtime Comment
          0 reexec 0m 0s Docker mode activated.
          -1 patch 0m 4s HDFS-12177 does not apply to trunk. Rebase required? Wrong Branch? See https://wiki.apache.org/hadoop/HowToContribute for help.



          Subsystem Report/Notes
          JIRA Issue HDFS-12177
          JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12878293/HDFS_9668_1.patch
          Console output https://builds.apache.org/job/PreCommit-HDFS-Build/20366/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 0s Docker mode activated. -1 patch 0m 4s HDFS-12177 does not apply to trunk. Rebase required? Wrong Branch? See https://wiki.apache.org/hadoop/HowToContribute for help. Subsystem Report/Notes JIRA Issue HDFS-12177 JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12878293/HDFS_9668_1.patch Console output https://builds.apache.org/job/PreCommit-HDFS-Build/20366/console Powered by Apache Yetus 0.6.0-SNAPSHOT http://yetus.apache.org This message was automatically generated.
          Hide
          brahmareddy Brahma Reddy Battula added a comment -

          can you please re-upload the patch with renaming like HDFS-12177-001-branch-2.8.patch and HDFS-12177-001-branch-2.7.patch to trigger jenkins against respective branch..?

          Show
          brahmareddy Brahma Reddy Battula added a comment - can you please re-upload the patch with renaming like HDFS-12177 -001-branch-2.8.patch and HDFS-12177 -001-branch-2.7.patch to trigger jenkins against respective branch..?
          Hide
          yangjiandan Jiandan Yang added a comment -

          OK, I have uploaded patch with branch-2.8 and branch-2.7

          Show
          yangjiandan Jiandan Yang added a comment - OK, I have uploaded patch with branch-2.8 and branch-2.7
          Hide
          hadoopqa Hadoop QA added a comment -
          -1 overall



          Vote Subsystem Runtime Comment
          0 reexec 0m 0s Docker mode activated.
          -1 patch 0m 4s HDFS-12177 does not apply to trunk. Rebase required? Wrong Branch? See https://wiki.apache.org/hadoop/HowToContribute for help.



          Subsystem Report/Notes
          JIRA Issue HDFS-12177
          JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12878304/HDFS-12177-001-branch-2.7.patch
          Console output https://builds.apache.org/job/PreCommit-HDFS-Build/20370/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 0s Docker mode activated. -1 patch 0m 4s HDFS-12177 does not apply to trunk. Rebase required? Wrong Branch? See https://wiki.apache.org/hadoop/HowToContribute for help. Subsystem Report/Notes JIRA Issue HDFS-12177 JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12878304/HDFS-12177-001-branch-2.7.patch Console output https://builds.apache.org/job/PreCommit-HDFS-Build/20370/console Powered by Apache Yetus 0.6.0-SNAPSHOT http://yetus.apache.org This message was automatically generated.
          Hide
          brahmareddy Brahma Reddy Battula added a comment -

          Re-uploading the patch, to kick in jenkins.

          Show
          brahmareddy Brahma Reddy Battula added a comment - Re-uploading the patch, to kick in jenkins.
          Hide
          hadoopqa Hadoop QA added a comment -
          -1 overall



          Vote Subsystem Runtime Comment
          0 reexec 0m 14s 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.
                branch-2.8 Compile Tests
          +1 mvninstall 8m 56s branch-2.8 passed
          +1 compile 0m 38s branch-2.8 passed with JDK v1.8.0_131
          +1 compile 0m 42s branch-2.8 passed with JDK v1.7.0_131
          +1 checkstyle 0m 22s branch-2.8 passed
          +1 mvnsite 0m 53s branch-2.8 passed
          +1 findbugs 1m 55s branch-2.8 passed
          +1 javadoc 0m 39s branch-2.8 passed with JDK v1.8.0_131
          +1 javadoc 0m 59s branch-2.8 passed with JDK v1.7.0_131
                Patch Compile Tests
          +1 mvninstall 0m 44s the patch passed
          +1 compile 0m 36s the patch passed with JDK v1.8.0_131
          +1 javac 0m 36s the patch passed
          +1 compile 0m 39s the patch passed with JDK v1.7.0_131
          +1 javac 0m 39s the patch passed
          +1 checkstyle 0m 19s the patch passed
          +1 mvnsite 0m 48s the patch passed
          +1 whitespace 0m 0s The patch has no whitespace issues.
          +1 findbugs 2m 6s the patch passed
          +1 javadoc 0m 36s the patch passed with JDK v1.8.0_131
          +1 javadoc 0m 57s the patch passed with JDK v1.7.0_131
                Other Tests
          +1 unit 47m 16s hadoop-hdfs in the patch passed with JDK v1.7.0_131.
          +1 asflicense 0m 21s The patch does not generate ASF License warnings.
          120m 38s



          Reason Tests
          JDK v1.8.0_131 Failed junit tests hadoop.hdfs.server.namenode.ha.TestFailureToReadEdits
            hadoop.hdfs.TestRollingUpgrade



          Subsystem Report/Notes
          Docker Image:yetus/hadoop:d946387
          JIRA Issue HDFS-12177
          JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12878305/HDFS-12177-branch-2.8-001.patch
          Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle
          uname Linux 1c06098d0179 3.13.0-119-generic #166-Ubuntu SMP Wed May 3 12:18:55 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
          Build tool maven
          Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh
          git revision branch-2.8 / f3bf1a6
          Default Java 1.7.0_131
          Multi-JDK versions /usr/lib/jvm/java-8-oracle:1.8.0_131 /usr/lib/jvm/java-7-openjdk-amd64:1.7.0_131
          findbugs v3.0.0
          JDK v1.7.0_131 Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/20371/testReport/
          modules C: hadoop-hdfs-project/hadoop-hdfs U: hadoop-hdfs-project/hadoop-hdfs
          Console output https://builds.apache.org/job/PreCommit-HDFS-Build/20371/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 14s 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.       branch-2.8 Compile Tests +1 mvninstall 8m 56s branch-2.8 passed +1 compile 0m 38s branch-2.8 passed with JDK v1.8.0_131 +1 compile 0m 42s branch-2.8 passed with JDK v1.7.0_131 +1 checkstyle 0m 22s branch-2.8 passed +1 mvnsite 0m 53s branch-2.8 passed +1 findbugs 1m 55s branch-2.8 passed +1 javadoc 0m 39s branch-2.8 passed with JDK v1.8.0_131 +1 javadoc 0m 59s branch-2.8 passed with JDK v1.7.0_131       Patch Compile Tests +1 mvninstall 0m 44s the patch passed +1 compile 0m 36s the patch passed with JDK v1.8.0_131 +1 javac 0m 36s the patch passed +1 compile 0m 39s the patch passed with JDK v1.7.0_131 +1 javac 0m 39s the patch passed +1 checkstyle 0m 19s the patch passed +1 mvnsite 0m 48s the patch passed +1 whitespace 0m 0s The patch has no whitespace issues. +1 findbugs 2m 6s the patch passed +1 javadoc 0m 36s the patch passed with JDK v1.8.0_131 +1 javadoc 0m 57s the patch passed with JDK v1.7.0_131       Other Tests +1 unit 47m 16s hadoop-hdfs in the patch passed with JDK v1.7.0_131. +1 asflicense 0m 21s The patch does not generate ASF License warnings. 120m 38s Reason Tests JDK v1.8.0_131 Failed junit tests hadoop.hdfs.server.namenode.ha.TestFailureToReadEdits   hadoop.hdfs.TestRollingUpgrade Subsystem Report/Notes Docker Image:yetus/hadoop:d946387 JIRA Issue HDFS-12177 JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12878305/HDFS-12177-branch-2.8-001.patch Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle uname Linux 1c06098d0179 3.13.0-119-generic #166-Ubuntu SMP Wed May 3 12:18:55 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux Build tool maven Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh git revision branch-2.8 / f3bf1a6 Default Java 1.7.0_131 Multi-JDK versions /usr/lib/jvm/java-8-oracle:1.8.0_131 /usr/lib/jvm/java-7-openjdk-amd64:1.7.0_131 findbugs v3.0.0 JDK v1.7.0_131 Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/20371/testReport/ modules C: hadoop-hdfs-project/hadoop-hdfs U: hadoop-hdfs-project/hadoop-hdfs Console output https://builds.apache.org/job/PreCommit-HDFS-Build/20371/console Powered by Apache Yetus 0.6.0-SNAPSHOT http://yetus.apache.org This message was automatically generated.
          Hide
          brahmareddy Brahma Reddy Battula added a comment -

          Re uploading the branch-2.7 to run Jenkins against

          Show
          brahmareddy Brahma Reddy Battula added a comment - Re uploading the branch-2.7 to run Jenkins against
          Hide
          brahmareddy Brahma Reddy Battula added a comment -

          Test failures are unrelated. Committed to branch-2.8,branch-2.8.2 and branch-2.7. Jiandan Yang thanks a lot for your contribution.

          Show
          brahmareddy Brahma Reddy Battula added a comment - Test failures are unrelated. Committed to branch-2.8 , branch-2.8.2 and branch-2.7 . Jiandan Yang thanks a lot for your contribution.

            People

            • Assignee:
              yangjiandan Jiandan Yang
              Reporter:
              yangjiandan Jiandan Yang
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development