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)
      
      

        Attachments

        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

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: