HBASE-17265 Region left unassigned in master failover when region failed to open (Allan Yang)

This commit is contained in:
tedyu 2017-02-09 12:43:37 -08:00
parent 807fcfd22f
commit 52c51fc271
2 changed files with 11 additions and 1 deletions

View File

@ -1091,7 +1091,7 @@ public class AssignmentManager extends ZooKeeperListener {
failedOpenTracker.remove(encodedName);
} else {
// Handle this the same as if it were opened and then closed.
regionState = regionStates.updateRegionState(rt, State.CLOSED);
regionState = regionStates.setRegionStateTOCLOSED(rt.getRegionName(), sn);
if (regionState != null) {
// When there are more than one region server a new RS is selected as the
// destination and the same is updated in the regionplan. (HBASE-5546)

View File

@ -419,6 +419,16 @@ public class RegionStates {
return oldState;
}
/**
* Set the region state to CLOSED
*/
public RegionState setRegionStateTOCLOSED(
final byte[] regionName,
final ServerName serverName) {
HRegionInfo regionInfo = getRegionInfo(regionName);
return setRegionStateTOCLOSED(regionInfo, serverName);
}
/**
* Set the region state to CLOSED
*/