|
@@ -2946,7 +2946,7 @@ public class FSNamesystem implements Namesystem, FSClusterStats,
|
|
|
*
|
|
|
* @see SafeModeInfo
|
|
|
*/
|
|
|
- private SafeModeInfo(boolean resourcesLow) {
|
|
|
+ private SafeModeInfo(boolean resourcesLow, boolean isReplQueuesInited) {
|
|
|
this.threshold = 1.5f; // this threshold can never be reached
|
|
|
this.datanodeThreshold = Integer.MAX_VALUE;
|
|
|
this.extension = Integer.MAX_VALUE;
|
|
@@ -2955,6 +2955,7 @@ public class FSNamesystem implements Namesystem, FSClusterStats,
|
|
|
this.blockTotal = -1;
|
|
|
this.blockSafe = -1;
|
|
|
this.resourcesLow = resourcesLow;
|
|
|
+ this.initializedReplQueues = isReplQueuesInited;
|
|
|
enter();
|
|
|
reportStatus("STATE* Safe mode is ON.", true);
|
|
|
}
|
|
@@ -3005,7 +3006,7 @@ public class FSNamesystem implements Namesystem, FSClusterStats,
|
|
|
}
|
|
|
if(needUpgrade) {
|
|
|
// switch to manual safe mode
|
|
|
- safeMode = new SafeModeInfo(false);
|
|
|
+ safeMode = new SafeModeInfo(false, isPopulatingReplQueues());
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
@@ -3356,6 +3357,10 @@ public class FSNamesystem implements Namesystem, FSClusterStats,
|
|
|
&& safeMode.isOn();
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * Check if replication queues are to be populated
|
|
|
+ * @return true when node is HAState.Active and not in the very first safemode
|
|
|
+ */
|
|
|
@Override
|
|
|
public boolean isPopulatingReplQueues() {
|
|
|
// safeMode is volatile, and may be set to null at any time
|
|
@@ -3452,7 +3457,7 @@ public class FSNamesystem implements Namesystem, FSClusterStats,
|
|
|
// is entirely stable on disk as soon as we're in safe mode.
|
|
|
getEditLog().logSyncAll();
|
|
|
if (!isInSafeMode()) {
|
|
|
- safeMode = new SafeModeInfo(resourcesLow);
|
|
|
+ safeMode = new SafeModeInfo(resourcesLow, isPopulatingReplQueues());
|
|
|
return;
|
|
|
}
|
|
|
if (resourcesLow) {
|