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

BlockPlacementPolicyDefault will cause NN shutdown if log level is changed

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 2.7.4, 3.0.0-alpha3
    • None
    • block placement
    • None

    Description

      In BlockPlacementPolicyDefault.chooseRandom method.
      The code are in below structure:

      StringBuilder builder = null;
          if (LOG.isDebugEnabled()) {
            builder = debugLoggingBuilder.get();
            builder.setLength(0);
            builder.append("[");
          }
      while(numOfReplicas > 0){
      .............
      chooseDataNode(scope, excludedNodes)
      .............
      if (LOG.isDebugEnabled()) {
              builder.append("\nNode ").append(NodeBase.getPath(chosenNode))
                  .append(" [");
            }
      }
      

      There's a possibility that the loglevel is INFO before entering while loop, but the loglevel is changed to DEBUG inside the loop through web UI.
      In that case, builder is not initialized in the beginning and NullPointerException will throw and this will cause NN exiting.

      Attachments

        1. HDFS-12416.patch
          2 kB
          Suhan Mao
        2. HDFS-12416.001.patch
          2 kB
          Suhan Mao

        Issue Links

          Activity

            People

              Unassigned Unassigned
              smao Suhan Mao
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 5h
                  5h
                  Remaining:
                  Remaining Estimate - 5h
                  5h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified