From be0bce1b7171c49e2dca22f56d4e750e606862fc Mon Sep 17 00:00:00 2001 From: Jing Zhao Date: Mon, 18 Apr 2016 18:05:49 -0700 Subject: [PATCH] HDFS-10306. SafeModeMonitor should not leave safe mode if name system is starting active service. Contributed by Mingliang Liu. --- .../hdfs/server/blockmanagement/BlockManagerSafeMode.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManagerSafeMode.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManagerSafeMode.java index e2d688ec81..ea70c86379 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManagerSafeMode.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManagerSafeMode.java @@ -623,7 +623,9 @@ public void run() { * the extension time has passed. */ private boolean canLeave() { - if (timeToLeaveExtension() > 0) { + if (namesystem.inTransitionToActive()) { + return false; + } else if (timeToLeaveExtension() > 0) { reportStatus("STATE* Safe mode ON, in safe mode extension.", false); return false; } else if (!areThresholdsMet()) {