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

HDFS NN will hang in safe mode and never come out if we change the dfs.namenode.replication.min bigger.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.0.0-alpha
    • None
    • namenode
    • None

    Description

      If the NN restarts with a new minimum replication (dfs.namenode.replication.min), any files created with the old replication count will expected to bump up to the new minimum upon restart automatically. However, the real case is that if the NN restarts will a new minimum replication which is bigger than the old one, the NN will hang in safemode and never come out.
      The corresponding test case can pass is because we have missing some test coverage. It had been discussed in HDFS-3734.
      If the NN received enough number of reported block which is satisfying the new minimum replication, it will exit safe mode. However, if we change a bigger minimum replication, there will be no enough amount blocks which are satisfying the limitation.
      Look at the code segment in FSNamesystem.java:
      private synchronized void incrementSafeBlockCount(short replication) {
      if (replication == safeReplication)

      { this.blockSafe++; checkMode(); }

      }
      The DNs report blocks to NN and if the replication is equal to safeReplication(It is assigned by the new minimum replication.), we will increment blockSafe. But if we change a bigger minimum replication, all the blocks whose replications are lower than it can not satisfy this equal relationship. But actually the NN had received complete block information. It cause blockSafe will not increment as usual and not reach the enough amount to exit safe mode and then NN hangs.

      Attachments

        Activity

          People

            Unassigned Unassigned
            yanboliang Yanbo Liang
            Votes:
            0 Vote for this issue
            Watchers:
            12 Start watching this issue

            Dates

              Created:
              Updated: