HBASE-20100 TestEnableTableProcedure flakey

Allow OPEN as a possible state when update region transition state.
Usually state is OPENING but if crash before finish step is completed,
on replay, master may have read that the state is OPEN from meta table
and so will think it open... When we replay the procedure finish, allow
that the region is already OPEN.
This commit is contained in:
Michael Stack 2018-02-27 12:06:48 -08:00
parent f01c90bc0e
commit ba063abd2f
3 changed files with 4 additions and 1 deletions

View File

@ -208,7 +208,7 @@ public class AssignProcedure extends RegionTransitionProcedure {
}
}
}
LOG.info("Start " + this + "; " + regionNode.toShortString() +
LOG.info("Starting " + this + "; " + regionNode.toShortString() +
"; forceNewPlan=" + this.forceNewPlan +
", retain=" + retain);
env.getAssignmentManager().queueAssign(regionNode);

View File

@ -60,6 +60,8 @@ public class RegionStates {
private static final Logger LOG = LoggerFactory.getLogger(RegionStates.class);
protected static final State[] STATES_EXPECTED_ON_OPEN = new State[] {
State.OPEN, // State may already be OPEN if we died after receiving the OPEN from regionserver
// but before complete finish of AssignProcedure. HBASE-20100.
State.OFFLINE, State.CLOSED, // disable/offline
State.SPLITTING, State.SPLIT, // ServerCrashProcedure
State.OPENING, State.FAILED_OPEN, // already in-progress (retrying)

View File

@ -317,6 +317,7 @@ public abstract class RegionTransitionProcedure
case REGION_TRANSITION_FINISH:
// 3. wait assignment response. completion/failure
LOG.debug("Finishing {}; {}", this, regionNode.toShortString());
finishTransition(env, regionNode);
am.removeRegionInTransition(regionNode, this);
return null;