private boolean isOpening(RegionStateNode regionNode, ServerName serverName, TransitionCode code) { if (!regionNode.isInState(State.OPENING)) { LOG.warn("Received report {} transition from {} for {}, pid={}, but the region is not in" + " OPENING state, should be a retry, ignore", code, serverName, regionNode, getProcId()); return false; } if (getCurrentState() != REGION_STATE_TRANSITION_CONFIRM_OPENED) { LOG.warn( "Received report {} transition from {} for {}, pid={}," + " but the TRSP is not in {} state, should be a retry, ignore", code, serverName, regionNode, getProcId(), REGION_STATE_TRANSITION_CONFIRM_OPENED); return false; } return true; }
public void serverCrashed(MasterProcedureEnv env, RegionStateNode regionNode, ServerName serverName) throws IOException { // Notice that, in this method, we do not change the procedure state, instead, we update the // region state in hbase:meta. This is because that, the procedure state change will not be // persisted until the region is woken up and finish one step, if we crash before that then the // information will be lost. So here we will update the region state in hbase:meta, and when the // procedure is woken up, it will process the error and jump to the correct procedure state. RegionStateTransitionState currentState = getCurrentState(); switch (currentState) { case REGION_STATE_TRANSITION_CLOSE: case REGION_STATE_TRANSITION_CONFIRM_CLOSED: case REGION_STATE_TRANSITION_CONFIRM_OPENED: // for these 3 states, the region may still be online on the crashed server env.getAssignmentManager().regionClosed(regionNode, false); if (currentState != RegionStateTransitionState.REGION_STATE_TRANSITION_CLOSE) { regionNode.getProcedureEvent().wake(env.getProcedureScheduler()); } break; default: // If the procedure is in other 2 states, then actually we should not arrive here, as we // know that the region is not online on any server, so we need to do nothing... But anyway // let's add a log here LOG.warn("{} received unexpected server crash call for region {} from {}", this, regionNode, serverName); } }
return; if (getCurrentState() != REGION_STATE_TRANSITION_CONFIRM_CLOSED) { LOG.warn( "Received report {} transition from {} for {}, pid={} but the proc is not in {}" +