HBASE-4052 reapply code in unassign() which handles NotServingRegionException

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1147819 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Zhihong Yu 2011-07-18 11:45:05 +00:00
parent 3b0a7528c9
commit 8ae3106b95
1 changed files with 17 additions and 14 deletions

View File

@ -1449,23 +1449,26 @@ public class AssignmentManager extends ZooKeeperListener {
// Presume that master has stale data. Presume remote side just split.
// Presume that the split message when it comes in will fix up the master's
// in memory cluster state.
if (checkIfRegionBelongsToDisabling(region)) {
// Remove from the regionsinTransition map
LOG.info("While trying to recover the table:"
+ region.getTableNameAsString()
+ " from DISABLING state to DISABLED state, the region:" + region
+ " was already offlined.");
synchronized (this.regionsInTransition) {
this.regionsInTransition.remove(region.getEncodedName());
}
// Remove from the regionsMap
synchronized (this.regions) {
this.regions.remove(region);
}
}
return;
} catch (Throwable t) {
if (t instanceof RemoteException) {
t = ((RemoteException)t).unwrapRemoteException();
if (t instanceof NotServingRegionException) {
if (checkIfRegionBelongsToDisabling(region)) {
// Remove from the regionsinTransition map
LOG.info("While trying to recover the table "
+ region.getTableNameAsString()
+ " to DISABLED state the region " + region
+ " was offlined but the table was in DISABLING state");
synchronized (this.regionsInTransition) {
this.regionsInTransition.remove(region.getEncodedName());
}
// Remove from the regionsMap
synchronized (this.regions) {
this.regions.remove(region);
}
}
}
}
LOG.info("Server " + server + " returned " + t + " for " +
region.getEncodedName());