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

datanodesSoftwareVersions map may counting wrong when rolling upgrade

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.7.1, 2.6.2
    • 2.8.0, 2.7.4, 3.0.0-alpha2
    • None
    • None
    • Reviewed

    Description

      While rolling upgrading, namenode's website overview will report there are two versions datanodes in the cluster, for example, 2.6.0 has x nodes and 2.6.2 has y nodes. However, sometimes when I stop a datanode in old version and start a new version one, namenode only increases the number of new version but not decreases the number of old version. So the total number x+y will be larger than the number of datanodes. Even all datanodes are upgraded, there will still have the messages that there are several datanode in old version. And I must run hdfs dfsadmin -refreshNodes to clear this message.

      I think this issue is caused by DatanodeManager.registerDatanode. If nodeS in old version is not alive because of shutting down, it will not pass shouldCountVersion, so the number of old version won't be decreased. But this method only judges the status of heartbeat and isAlive at that moment, if namenode has not removed this node which will decrease the version map and this node restarts in the new version, the decrementVersionCount belongs to this node will never be executed.

      So the simplest way to fix this is that we always recounting the version map in registerDatanode since it is not a heavy operation.

      Attachments

        1. 9500-v1.patch
          2 kB
          Phil Yang
        2. HDFS-9500.000.patch
          3 kB
          Erik Krogen
        3. HDFS-9500.001.patch
          4 kB
          Erik Krogen
        4. HDFS-9500.002.patch
          4 kB
          Erik Krogen

        Activity

          People

            xkrogen Erik Krogen
            yangzhe1991 Phil Yang
            Votes:
            0 Vote for this issue
            Watchers:
            12 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: