HBASE-17264 Processing RIT with offline state will always fail to open the first time (Allan Yang)

This commit is contained in:
tedyu 2017-02-06 19:48:14 -08:00
parent f708d986a0
commit 0a0aef345a
1 changed files with 4 additions and 3 deletions

View File

@ -874,7 +874,7 @@ public class AssignmentManager extends ZooKeeperListener {
case M_ZK_REGION_OFFLINE:
// Insert in RIT and resend to the regionserver
regionStates.updateRegionState(rt, State.PENDING_OPEN);
regionStates.updateRegionState(rt, State.OFFLINE);
final RegionState rsOffline = regionStates.getRegionState(regionInfo);
this.executorService.submit(
new EventHandler(server, EventType.M_MASTER_RECOVERY) {
@ -884,7 +884,7 @@ public class AssignmentManager extends ZooKeeperListener {
try {
RegionPlan plan = new RegionPlan(regionInfo, null, sn);
addPlan(encodedName, plan);
assign(rsOffline, false, false);
assign(rsOffline, true, false);
} finally {
lock.unlock();
}
@ -1608,6 +1608,7 @@ public class AssignmentManager extends ZooKeeperListener {
/**
* Use care with forceNewPlan. It could cause double assignment.
*/
@VisibleForTesting
public void assign(HRegionInfo region,
boolean setOfflineInZK, boolean forceNewPlan) {
if (isDisabledorDisablingRegionInRIT(region)) {
@ -2085,7 +2086,7 @@ public class AssignmentManager extends ZooKeeperListener {
* @param setOfflineInZK
* @param forceNewPlan
*/
private void assign(RegionState state,
public void assign(RegionState state,
boolean setOfflineInZK, final boolean forceNewPlan) {
long startTime = EnvironmentEdgeManager.currentTime();
try {