@InterfaceAudience.Private public class ServerCrashProcedure extends StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.ServerCrashState> implements ServerProcedureInterface
The procedure flow varies dependent on whether meta is assigned and if we are to split logs.
We come in here after ServerManager has noticed a server has expired. Procedures queued on the rpc should have been notified about fail and should be concurrently getting themselves ready to assign elsewhere.
StateMachineProcedure.FlowProcedure.LockStateServerProcedureInterface.ServerOperationType| Modifier and Type | Field and Description |
|---|---|
static boolean |
DEFAULT_MASTER_SCP_RETAIN_ASSIGNMENT
Default value of
MASTER_SCP_RETAIN_ASSIGNMENT |
static String |
MASTER_SCP_RETAIN_ASSIGNMENT
Configuration parameter to enable/disable the retain region assignment during
ServerCrashProcedure.
|
stateCountNO_PROC_ID, NO_TIMEOUT| 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, failIfAborted, getCurrentState, getCurrentStateId, getCycles, isEofState, isRollbackSupported, isYieldAfterExecutionStep, isYieldBeforeExecuteFromState, rollback, setNextState, toStringStateaddStackIndex, afterReplay, beforeReplay, bypass, compareTo, completionCleanup, doExecute, doRollback, elapsedTime, getChildrenLatch, getException, getLastUpdate, getNonceKey, getOwner, getParentProcId, getProcId, getProcIdHashCode, getResult, getRootProcedureId, getRootProcId, getStackIndexes, getState, getSubmittedTime, getTimeout, getTimeoutTimestamp, hasChildren, hasException, hasLock, hasOwner, hasParent, hasTimeout, haveSameParent, incChildrenLatch, isBypass, isFailed, isFinished, isInitializing, isLockedWhenLoading, isRunnable, isSuccess, isWaiting, removeStackIndex, setAbortFailure, setChildrenLatch, setFailure, setFailure, setLastUpdate, setNonceKey, setOwner, setOwner, setParentProcId, setProcId, setResult, setRootProcId, setStackIndexes, setState, setSubmittedTime, setTimeout, setTimeoutFailure, skipPersistence, toString, toStringClass, toStringDetails, toStringSimpleSB, updateMetricsOnFinish, updateMetricsOnSubmit, updateTimestamp, waitInitialized, wasExecutedpublic static final String MASTER_SCP_RETAIN_ASSIGNMENT
By default retain assignment is disabled which makes the failover faster and improve the availability; useful for cloud scenario where region block locality is not important. Enable this when RegionServers are deployed on same host where Datanode are running, this will improve read performance due to local read.
see HBASE-24900 for more details.
public static final boolean DEFAULT_MASTER_SCP_RETAIN_ASSIGNMENT
MASTER_SCP_RETAIN_ASSIGNMENTpublic 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()
public boolean isInRecoverMetaState()
protected StateMachineProcedure.Flow executeFromState(MasterProcedureEnv env, org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.ServerCrashState state) throws ProcedureSuspendedException, ProcedureYieldException
protected void rollbackState(MasterProcedureEnv env, org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.ServerCrashState state) throws IOException
protected org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.ServerCrashState getState(int stateId)
protected int getStateId(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.ServerCrashState state)
protected org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.ServerCrashState getInitialState()
protected boolean abort(MasterProcedureEnv env)
protected Procedure.LockState 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 String getProcName()
getProcName in class Procedure<MasterProcedureEnv>protected void serializeStateData(ProcedureStateSerializer serializer) throws IOException
protected void deserializeStateData(ProcedureStateSerializer serializer) throws IOException
public ServerName getServerName()
ServerProcedureInterfacegetServerName in interface ServerProcedureInterfacepublic boolean hasMetaTableRegion()
ServerProcedureInterfacehasMetaTableRegion in interface ServerProcedureInterfacepublic ServerProcedureInterface.ServerOperationType getServerOperationType()
ServerProcedureInterfacegetServerOperationType in interface ServerProcedureInterfaceprotected boolean shouldWaitClientAck(MasterProcedureEnv env)
shouldWaitClientAck in class Procedure<MasterProcedureEnv>protected boolean isMatchingRegionLocation(RegionStateNode rsn)
rsn matches that of this crashed server.protected ProcedureMetrics getProcedureMetrics(MasterProcedureEnv env)
getProcedureMetrics in class Procedure<MasterProcedureEnv>protected boolean holdLock(MasterProcedureEnv env)
holdLock in class Procedure<MasterProcedureEnv>public static void updateProgress(MasterProcedureEnv env, long parentId)
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.