public class ServerCrashProcedure extends StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.protobuf.generated.MasterProcedureProtos.ServerCrashState> implements ServerProcedureInterface
The procedure flow varies dependent on whether meta is assigned, if we are doing distributed log replay versus distributed log splitting, and if we are to split logs at all.
This procedure asks that all crashed servers get processed equally; we yield after the completion of each successful flow step. We do this so that we do not 'deadlock' waiting on a region assignment so we can replay edits which could happen if a region moved there are edits on two servers for replay.
TODO: ASSIGN and WAIT_ON_ASSIGN (at least) are not idempotent. Revisit when assign is pv2. TODO: We do not have special handling for system tables.
StateMachineProcedure.FlowServerProcedureInterface.ServerOperationType| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_RETRIES_ON_META |
static int |
DEFAULT_SHORT_WAIT_ON_META |
static int |
DEFAULT_WAIT_ON_RIT |
static String |
KEY_RETRIES_ON_META
Configuration key to set how many retries to cycle before we give up on meta.
|
static String |
KEY_SHORT_WAIT_ON_META
Configuration key to set how long to wait in ms doing a quick check on meta state.
|
static String |
KEY_WAIT_ON_RIT
Configuration key to set how long to wait in ms on regions in transition.
|
| Constructor and Description |
|---|
ServerCrashProcedure()
Used when deserializing from a procedure store; we'll construct one of these then call
deserializeStateData(InputStream). |
ServerCrashProcedure(MasterProcedureEnv env,
ServerName serverName,
boolean shouldSplitWal,
boolean carryingMeta)
Call this constructor queuing up a Procedure.
|
addChildProcedure, execute, isYieldAfterExecutionStep, rollback, setNextState, toStringStateaddStackIndex, beforeReplay, childrenCountDown, compareTo, completionCleanup, convert, convert, createProcedureInfo, doExecute, doRollback, elapsedTime, getException, getLastUpdate, getNonceKey, getOwner, getParentProcId, getProcId, getProcIdHashCode, getResult, getRootProcedureId, getStackIndexes, getStartTime, getState, getTimeout, getTimeRemaining, hasChildren, hasException, hasOwner, hasParent, hasTimeout, incChildrenLatch, isFailed, isFinished, isRunnable, isSuccess, isWaiting, newInstance, removeStackIndex, setAbortFailure, setChildrenLatch, setFailure, setFailure, setNonceKey, setOwner, setParentProcId, setProcId, setResult, setStackIndexes, setStartTime, setState, setTimeout, setTimeoutFailure, toString, toStringClass, toStringDetails, toStringSimpleSB, updateTimestamp, validateClass, wasExecutedpublic static final String KEY_SHORT_WAIT_ON_META
public static final int DEFAULT_SHORT_WAIT_ON_META
public static final String KEY_RETRIES_ON_META
KEY_SHORT_WAIT_ON_META milliseconds.public static final int DEFAULT_RETRIES_ON_META
public static final String KEY_WAIT_ON_RIT
public static final int DEFAULT_WAIT_ON_RIT
public ServerCrashProcedure(MasterProcedureEnv env, ServerName serverName, boolean shouldSplitWal, boolean carryingMeta)
serverName - Name of the crashed server.shouldSplitWal - True if we should split WALs as part of crashed server processing.carryingMeta - True if carrying hbase:meta table region.public ServerCrashProcedure()
deserializeStateData(InputStream). Do not use directly.protected StateMachineProcedure.Flow executeFromState(MasterProcedureEnv env, org.apache.hadoop.hbase.protobuf.generated.MasterProcedureProtos.ServerCrashState state) throws ProcedureYieldException
protected void rollbackState(MasterProcedureEnv env, org.apache.hadoop.hbase.protobuf.generated.MasterProcedureProtos.ServerCrashState state) throws IOException
rollbackState in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.protobuf.generated.MasterProcedureProtos.ServerCrashState>IOExceptionprotected org.apache.hadoop.hbase.protobuf.generated.MasterProcedureProtos.ServerCrashState getState(int stateId)
protected int getStateId(org.apache.hadoop.hbase.protobuf.generated.MasterProcedureProtos.ServerCrashState state)
protected org.apache.hadoop.hbase.protobuf.generated.MasterProcedureProtos.ServerCrashState getInitialState()
protected boolean abort(MasterProcedureEnv env)
abort in class Procedure<MasterProcedureEnv>protected boolean acquireLock(MasterProcedureEnv env)
acquireLock in class Procedure<MasterProcedureEnv>protected void releaseLock(MasterProcedureEnv env)
releaseLock in class Procedure<MasterProcedureEnv>public void toStringClassDetails(StringBuilder sb)
toStringClassDetails in class Procedure<MasterProcedureEnv>public void serializeStateData(OutputStream stream) throws IOException
public void deserializeStateData(InputStream stream) throws IOException
public ServerName getServerName()
getServerName in interface ServerProcedureInterfacepublic boolean hasMetaTableRegion()
hasMetaTableRegion in interface ServerProcedureInterfacepublic ServerProcedureInterface.ServerOperationType getServerOperationType()
ServerProcedureInterfacegetServerOperationType in interface ServerProcedureInterfaceprotected boolean isYieldBeforeExecuteFromState(MasterProcedureEnv env, org.apache.hadoop.hbase.protobuf.generated.MasterProcedureProtos.ServerCrashState state)
protected boolean shouldWaitClientAck(MasterProcedureEnv env)
shouldWaitClientAck in class Procedure<MasterProcedureEnv>Copyright © 2007–2018 The Apache Software Foundation. All rights reserved.