|
@@ -3917,8 +3917,7 @@ public class FSNamesystem implements FSConstants, FSNamesystemMBean {
|
|
* Switch to manual safe mode if distributed upgrade is required.<br>
|
|
* Switch to manual safe mode if distributed upgrade is required.<br>
|
|
* Check for invalid, under- & over-replicated blocks in the end of startup.
|
|
* Check for invalid, under- & over-replicated blocks in the end of startup.
|
|
*/
|
|
*/
|
|
- synchronized void leave(boolean checkForUpgrades,
|
|
|
|
- boolean checkBlockReplication) {
|
|
|
|
|
|
+ synchronized void leave(boolean checkForUpgrades) {
|
|
if(checkForUpgrades) {
|
|
if(checkForUpgrades) {
|
|
// verify whether a distributed upgrade needs to be started
|
|
// verify whether a distributed upgrade needs to be started
|
|
boolean needUpgrade = false;
|
|
boolean needUpgrade = false;
|
|
@@ -3933,9 +3932,8 @@ public class FSNamesystem implements FSConstants, FSNamesystemMBean {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if(checkBlockReplication)
|
|
|
|
- // verify blocks replications
|
|
|
|
- processMisReplicatedBlocks();
|
|
|
|
|
|
+ // verify blocks replications
|
|
|
|
+ processMisReplicatedBlocks();
|
|
long timeInSafemode = now() - systemStart;
|
|
long timeInSafemode = now() - systemStart;
|
|
NameNode.stateChangeLog.info("STATE* Leaving safe mode after "
|
|
NameNode.stateChangeLog.info("STATE* Leaving safe mode after "
|
|
+ timeInSafemode/1000 + " secs.");
|
|
+ timeInSafemode/1000 + " secs.");
|
|
@@ -3997,7 +3995,7 @@ public class FSNamesystem implements FSConstants, FSNamesystemMBean {
|
|
// the threshold is reached
|
|
// the threshold is reached
|
|
if (!isOn() || // safe mode is off
|
|
if (!isOn() || // safe mode is off
|
|
extension <= 0 || threshold <= 0) { // don't need to wait
|
|
extension <= 0 || threshold <= 0) { // don't need to wait
|
|
- this.leave(true, false); // leave safe mode
|
|
|
|
|
|
+ this.leave(true); // leave safe mode
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
if (reached > 0) { // threshold has already been reached before
|
|
if (reached > 0) { // threshold has already been reached before
|
|
@@ -4135,7 +4133,7 @@ public class FSNamesystem implements FSConstants, FSNamesystemMBean {
|
|
}
|
|
}
|
|
// leave safe mode and stop the monitor
|
|
// leave safe mode and stop the monitor
|
|
if(safeMode != null)
|
|
if(safeMode != null)
|
|
- safeMode.leave(true, true);
|
|
|
|
|
|
+ safeMode.leave(true);
|
|
smmthread = null;
|
|
smmthread = null;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -4153,7 +4151,7 @@ public class FSNamesystem implements FSConstants, FSNamesystemMBean {
|
|
checkSuperuserPrivilege();
|
|
checkSuperuserPrivilege();
|
|
switch(action) {
|
|
switch(action) {
|
|
case SAFEMODE_LEAVE: // leave safe mode
|
|
case SAFEMODE_LEAVE: // leave safe mode
|
|
- leaveSafeMode(false, true);
|
|
|
|
|
|
+ leaveSafeMode(false);
|
|
break;
|
|
break;
|
|
case SAFEMODE_ENTER: // enter safe mode
|
|
case SAFEMODE_ENTER: // enter safe mode
|
|
enterSafeMode();
|
|
enterSafeMode();
|
|
@@ -4224,9 +4222,7 @@ public class FSNamesystem implements FSConstants, FSNamesystemMBean {
|
|
* Leave safe mode.
|
|
* Leave safe mode.
|
|
* @throws IOException
|
|
* @throws IOException
|
|
*/
|
|
*/
|
|
- synchronized void leaveSafeMode(boolean checkForUpgrades,
|
|
|
|
- boolean checkBlockReplication
|
|
|
|
- ) throws IOException {
|
|
|
|
|
|
+ synchronized void leaveSafeMode(boolean checkForUpgrades) throws IOException {
|
|
if (!isInSafeMode()) {
|
|
if (!isInSafeMode()) {
|
|
NameNode.stateChangeLog.info("STATE* Safe mode is already OFF.");
|
|
NameNode.stateChangeLog.info("STATE* Safe mode is already OFF.");
|
|
return;
|
|
return;
|
|
@@ -4234,7 +4230,7 @@ public class FSNamesystem implements FSConstants, FSNamesystemMBean {
|
|
if(getDistributedUpgradeState())
|
|
if(getDistributedUpgradeState())
|
|
throw new SafeModeException("Distributed upgrade is in progress",
|
|
throw new SafeModeException("Distributed upgrade is in progress",
|
|
safeMode);
|
|
safeMode);
|
|
- safeMode.leave(checkForUpgrades, checkBlockReplication);
|
|
|
|
|
|
+ safeMode.leave(checkForUpgrades);
|
|
}
|
|
}
|
|
|
|
|
|
String getSafeModeTip() {
|
|
String getSafeModeTip() {
|