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()) {