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

JspHelper#bestNode() doesn't handle bad datanodes correctly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Cannot Reproduce
    • 2.1.0-beta, 3.0.0-alpha1
    • None
    • None
    • None

    Description

      JspHelper#bestNode() doesn't handle correctly if the chosen datanode is down.

          while (s == null) {
            if (chosenNode == null) {
              do {
                if (doRandom) {
                  index = DFSUtil.getRandom().nextInt(nodes.length);
                } else {
                  index++;
                }
                chosenNode = nodes[index];
              } while (deadNodes.contains(chosenNode));
            }
            chosenNode = nodes[index];
      

      In this part of the code, choosing the datanode will be done only once.
      If the chosen datanode is down, then definitely exception will be thrown instead of re-chosing the available node.

      Attachments

        1. HDFS-5146.patch
          3 kB
          Vinayakumar B

        Activity

          People

            vinayakumarb Vinayakumar B
            vinayakumarb Vinayakumar B
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: