use of org.apache.hadoop.hbase.master.procedure.ServerCrashProcedure in project hbase by apache.
the class ServerManager method expireServer.
/*
* Expire the passed server. Add it to list of dead servers and queue a
* shutdown processing.
*/
public synchronized void expireServer(final ServerName serverName) {
if (serverName.equals(master.getServerName())) {
if (!(master.isAborted() || master.isStopped())) {
master.stop("We lost our znode?");
}
return;
}
if (!master.isServerCrashProcessingEnabled()) {
LOG.info("Master doesn't enable ServerShutdownHandler during initialization, " + "delay expiring server " + serverName);
this.queuedDeadServers.add(serverName);
return;
}
if (this.deadservers.isDeadServer(serverName)) {
// TODO: Can this happen? It shouldn't be online in this case?
LOG.warn("Expiration of " + serverName + " but server shutdown already in progress");
return;
}
moveFromOnlineToDeadServers(serverName);
// process as a dead server
if (this.clusterShutdown) {
LOG.info("Cluster shutdown set; " + serverName + " expired; onlineServers=" + this.onlineServers.size());
if (this.onlineServers.isEmpty()) {
master.stop("Cluster shutdown set; onlineServer=0");
}
return;
}
boolean carryingMeta = master.getAssignmentManager().isCarryingMeta(serverName);
ProcedureExecutor<MasterProcedureEnv> procExec = this.master.getMasterProcedureExecutor();
procExec.submitProcedure(new ServerCrashProcedure(procExec.getEnvironment(), serverName, true, carryingMeta));
LOG.debug("Added=" + serverName + " to dead servers, submitted shutdown handler to be executed meta=" + carryingMeta);
// Tell our listeners that a server was removed
if (!this.listeners.isEmpty()) {
for (ServerListener listener : this.listeners) {
listener.serverRemoved(serverName);
}
}
}
use of org.apache.hadoop.hbase.master.procedure.ServerCrashProcedure in project hbase by apache.
the class TestDeadServer method testCrashProcedureReplay.
@Test(timeout = 15000)
public void testCrashProcedureReplay() {
HMaster master = TEST_UTIL.getHBaseCluster().getMaster();
final ProcedureExecutor<MasterProcedureEnv> pExecutor = master.getMasterProcedureExecutor();
ServerCrashProcedure proc = new ServerCrashProcedure(pExecutor.getEnvironment(), hostname123, false, false);
ProcedureTestingUtility.submitAndWait(pExecutor, proc);
assertFalse(master.getServerManager().getDeadServers().areDeadServersInProgress());
}
use of org.apache.hadoop.hbase.master.procedure.ServerCrashProcedure in project hbase by apache.
the class ServerManager method processDeadServer.
public synchronized void processDeadServer(final ServerName serverName, boolean shouldSplitWal) {
// the corresponding server is down. So we queue them up here instead.
if (!master.getAssignmentManager().isFailoverCleanupDone()) {
requeuedDeadServers.put(serverName, shouldSplitWal);
return;
}
this.deadservers.add(serverName);
ProcedureExecutor<MasterProcedureEnv> procExec = this.master.getMasterProcedureExecutor();
procExec.submitProcedure(new ServerCrashProcedure(procExec.getEnvironment(), serverName, shouldSplitWal, false));
}
Aggregations