HBASE-14875 Forward port HBASE-14207 'Region was hijacked and remained in transition when RS failed to open a region and later regionplan changed to new RS on retry'
This commit is contained in:
parent
07b07300b8
commit
1917516ffd
|
@ -2051,7 +2051,7 @@ public class AssignmentManager extends ZooKeeperListener {
|
||||||
* @param forceNewPlan
|
* @param forceNewPlan
|
||||||
*/
|
*/
|
||||||
private void assign(RegionState state,
|
private void assign(RegionState state,
|
||||||
final boolean setOfflineInZK, final boolean forceNewPlan) {
|
boolean setOfflineInZK, final boolean forceNewPlan) {
|
||||||
long startTime = EnvironmentEdgeManager.currentTime();
|
long startTime = EnvironmentEdgeManager.currentTime();
|
||||||
try {
|
try {
|
||||||
Configuration conf = server.getConfiguration();
|
Configuration conf = server.getConfiguration();
|
||||||
|
@ -2097,6 +2097,7 @@ public class AssignmentManager extends ZooKeeperListener {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (setOfflineInZK && versionOfOfflineNode == -1) {
|
if (setOfflineInZK && versionOfOfflineNode == -1) {
|
||||||
|
LOG.info("Setting node as OFFLINED in ZooKeeper for region " + region);
|
||||||
// get the version of the znode after setting it to OFFLINE.
|
// get the version of the znode after setting it to OFFLINE.
|
||||||
// versionOfOfflineNode will be -1 if the znode was not set to OFFLINE
|
// versionOfOfflineNode will be -1 if the znode was not set to OFFLINE
|
||||||
versionOfOfflineNode = setOfflineInZooKeeper(currentState, plan.getDestination());
|
versionOfOfflineNode = setOfflineInZooKeeper(currentState, plan.getDestination());
|
||||||
|
@ -2266,8 +2267,13 @@ public class AssignmentManager extends ZooKeeperListener {
|
||||||
// Clean out plan we failed execute and one that doesn't look like it'll
|
// Clean out plan we failed execute and one that doesn't look like it'll
|
||||||
// succeed anyways; we need a new plan!
|
// succeed anyways; we need a new plan!
|
||||||
// Transition back to OFFLINE
|
// Transition back to OFFLINE
|
||||||
|
LOG.info("Region assignment plan changed from " + plan.getDestination() + " to "
|
||||||
|
+ newPlan.getDestination() + " server.");
|
||||||
currentState = regionStates.updateRegionState(region, State.OFFLINE);
|
currentState = regionStates.updateRegionState(region, State.OFFLINE);
|
||||||
versionOfOfflineNode = -1;
|
versionOfOfflineNode = -1;
|
||||||
|
if (useZKForAssignment) {
|
||||||
|
setOfflineInZK = true;
|
||||||
|
}
|
||||||
plan = newPlan;
|
plan = newPlan;
|
||||||
} else if(plan.getDestination().equals(newPlan.getDestination()) &&
|
} else if(plan.getDestination().equals(newPlan.getDestination()) &&
|
||||||
previousException instanceof FailedServerException) {
|
previousException instanceof FailedServerException) {
|
||||||
|
|
Loading…
Reference in New Issue