HBASE-17275 Assign timeout may cause region to be unassigned forever (Allan yang)

This commit is contained in:
tedyu 2017-02-07 12:57:07 -08:00
parent 0553290c6a
commit a75e5a5435

View File

@ -1128,10 +1128,19 @@ public class AssignmentManager extends ZooKeeperListener {
+ regionStates.getRegionState(encodedName));
if (regionState != null) {
// Close it without updating the internal region states,
// so as not to create double assignments in unlucky scenarios
// mentioned in OpenRegionHandler#process
unassign(regionState.getRegion(), null, -1, null, false, sn);
if(regionState.isOpened() && regionState.getServerName().equals(sn)) {
//if this region was opened before on this rs, we don't have to unassign it. It won't cause
//double assign. One possible scenario of what happened is HBASE-17275
failedOpenTracker.remove(encodedName); // reset the count, if any
new OpenedRegionHandler(
server, this, regionState.getRegion(), coordination, ord).process();
updateOpenedRegionHandlerTracker(regionState.getRegion());
} else {
// Close it without updating the internal region states,
// so as not to create double assignments in unlucky scenarios
// mentioned in OpenRegionHandler#process
unassign(regionState.getRegion(), null, -1, null, false, sn);
}
}
return;
}