浏览代码

HDFS-1145. When NameNode is shutdown it does not try to exit
safemode anymore. (dhruba)



git-svn-id: https://svn.apache.org/repos/asf/hadoop/hdfs/trunk@959874 13f79535-47bb-0310-9956-ffa450edef68

Dhruba Borthakur 15 年之前
父节点
当前提交
a545072177
共有 2 个文件被更改,包括 14 次插入7 次删除
  1. 3 0
      CHANGES.txt
  2. 11 7
      src/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java

+ 3 - 0
CHANGES.txt

@@ -102,6 +102,9 @@ Trunk (unreleased changes)
     HDFS-1250. Namenode should reject block reports and block received
     HDFS-1250. Namenode should reject block reports and block received
     requests from dead datanodes (suresh)
     requests from dead datanodes (suresh)
 
 
+    HDFS-1145. When NameNode is shutdown it does not try to exit
+    safemode anymore. (dhruba)
+
 Release 0.21.0 - Unreleased
 Release 0.21.0 - Unreleased
 
 
   INCOMPATIBLE CHANGES
   INCOMPATIBLE CHANGES

+ 11 - 7
src/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java

@@ -3746,13 +3746,17 @@ public class FSNamesystem implements FSConstants, FSNamesystemMBean, FSClusterSt
         } catch (InterruptedException ie) {
         } catch (InterruptedException ie) {
         }
         }
       }
       }
-      // leave safe mode and stop the monitor
-      try {
-        leaveSafeMode(true);
-      } catch(SafeModeException es) { // should never happen
-        String msg = "SafeModeMonitor may not run during distributed upgrade.";
-        assert false : msg;
-        throw new RuntimeException(msg, es);
+      if (!fsRunning) {
+        LOG.info("NameNode is being shutdown, exit SafeModeMonitor thread. ");
+      } else {
+        // leave safe mode and stop the monitor
+        try {
+          leaveSafeMode(true);
+        } catch(SafeModeException es) { // should never happen
+          String msg = "SafeModeMonitor may not run during distributed upgrade.";
+          assert false : msg;
+          throw new RuntimeException(msg, es);
+        }
       }
       }
       smmthread = null;
       smmthread = null;
     }
     }