@InterfaceAudience.Private public class UnassignProcedure extends RegionTransitionProcedure
The Unassign starts by placing a "close region" request in the Remote Dispatcher queue, and the procedure will then go into a "waiting state" (suspend). The Remote Dispatcher will batch the various requests for that server and they will be sent to the RS for execution. The RS will complete the open operation by calling master.reportRegionStateTransition(). The AM will intercept the transition report, and notify this procedure. The procedure will wakeup and finish the unassign by publishing its new state on meta.
If we are unable to contact the remote regionserver whether because of ConnectException or socket timeout, we will call expire on the server we were trying to contact. We will remain in suspended state waiting for a wake up from the ServerCrashProcedure that is processing the failed server. The basic idea is that if we notice a crashed server, then we have a responsibility; i.e. we should not let go of the region until we are sure the server that was hosting has had its crash processed. If we let go of the region before then, an assign might run before the logs have been split which would make for data loss.
TODO: Rather than this tricky coordination between SCP and this Procedure, instead, work on returning a SCP as our subprocedure; probably needs work on the framework to do this, especially if the SCP already created.
Procedure.LockState
TableProcedureInterface.TableOperationType
Modifier and Type | Field and Description |
---|---|
protected ServerName |
destinationServer
The Server we will subsequently assign the region too (can be null).
|
protected ServerName |
hostingServer
Where to send the unassign RPC.
|
aborted
NO_PROC_ID, NO_TIMEOUT
Constructor and Description |
---|
UnassignProcedure() |
UnassignProcedure(HRegionInfo regionInfo,
ServerName hostingServer,
boolean force) |
UnassignProcedure(HRegionInfo regionInfo,
ServerName hostingServer,
ServerName destinationServer,
boolean force) |
abort, acquireLock, addToRemoteDispatcher, execute, getRegionInfo, getRegionState, getTableName, getTransitionState, hasLock, holdLock, isMeta, isServerOnline, isServerOnline, releaseLock, remoteCallCompleted, remoteCallFailed, reportTransition, rollback, setRegionInfo, setTransitionState, shouldWaitClientAck, toStringState
addStackIndex, afterReplay, beforeReplay, compareTo, completionCleanup, doAcquireLock, doExecute, doReleaseLock, doRollback, elapsedTime, getChildrenLatch, getException, getLastUpdate, getNonceKey, getOwner, getParentProcId, getProcId, getProcIdHashCode, getProcName, getResult, getRootProcedureId, getRootProcId, getStackIndexes, getState, getSubmittedTime, getTimeout, getTimeoutTimestamp, hasChildren, hasException, hasOwner, hasParent, hasTimeout, haveSameParent, incChildrenLatch, isFailed, isFinished, isInitializing, isRunnable, isSuccess, isWaiting, isYieldAfterExecutionStep, removeStackIndex, setAbortFailure, setChildrenLatch, setFailure, setFailure, setLastUpdate, setNonceKey, setOwner, setOwner, setParentProcId, setProcId, setResult, setRootProcId, setStackIndexes, setState, setSubmittedTime, setTimeout, setTimeoutFailure, toString, toStringClass, toStringDetails, toStringSimpleSB, updateMetricsOnFinish, updateMetricsOnSubmit, updateTimestamp, wasExecuted
protected volatile ServerName hostingServer
protected volatile ServerName destinationServer
public UnassignProcedure()
public UnassignProcedure(HRegionInfo regionInfo, ServerName hostingServer, boolean force)
public UnassignProcedure(HRegionInfo regionInfo, ServerName hostingServer, ServerName destinationServer, boolean force)
public TableProcedureInterface.TableOperationType getTableOperationType()
TableProcedureInterface
protected boolean isRollbackSupported(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.RegionTransitionState state)
isRollbackSupported
in class RegionTransitionProcedure
protected void serializeStateData(ProcedureStateSerializer serializer) throws IOException
serializeStateData
in class Procedure<MasterProcedureEnv>
IOException
protected void deserializeStateData(ProcedureStateSerializer serializer) throws IOException
deserializeStateData
in class Procedure<MasterProcedureEnv>
IOException
protected boolean startTransition(MasterProcedureEnv env, RegionStates.RegionStateNode regionNode)
startTransition
in class RegionTransitionProcedure
protected boolean updateTransition(MasterProcedureEnv env, RegionStates.RegionStateNode regionNode) throws IOException
RegionTransitionProcedure
updateTransition
in class RegionTransitionProcedure
IOException
protected void finishTransition(MasterProcedureEnv env, RegionStates.RegionStateNode regionNode) throws IOException
finishTransition
in class RegionTransitionProcedure
IOException
public RemoteProcedureDispatcher.RemoteOperation remoteCallBuild(MasterProcedureEnv env, ServerName serverName)
remoteCallBuild
in interface RemoteProcedureDispatcher.RemoteProcedure<MasterProcedureEnv,ServerName>
remoteCallBuild
in class RegionTransitionProcedure
protected void reportTransition(MasterProcedureEnv env, RegionStates.RegionStateNode regionNode, org.apache.hadoop.hbase.shaded.protobuf.generated.RegionServerStatusProtos.RegionStateTransition.TransitionCode code, long seqId) throws UnexpectedStateException
reportTransition
in class RegionTransitionProcedure
UnexpectedStateException
protected boolean remoteCallFailed(MasterProcedureEnv env, RegionStates.RegionStateNode regionNode, IOException exception)
remoteCallFailed
in class RegionTransitionProcedure
public void toStringClassDetails(StringBuilder sb)
toStringClassDetails
in class RegionTransitionProcedure
public ServerName getServer(MasterProcedureEnv env)
RegionTransitionProcedure
getServer
in class RegionTransitionProcedure
protected ProcedureMetrics getProcedureMetrics(MasterProcedureEnv env)
getProcedureMetrics
in class Procedure<MasterProcedureEnv>
Copyright © 2007–2017 The Apache Software Foundation. All rights reserved.