HBASE-5829 Inconsistency between the "regions" map and the "servers" map in AssignmentManager

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1330993 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2012-04-26 17:51:17 +00:00
parent d7110681df
commit 6d848a1943
1 changed files with 5 additions and 0 deletions

View File

@ -1663,6 +1663,7 @@ public class AssignmentManager extends ZooKeeperListener {
}
synchronized (this.regions) {
this.regions.put(plan.getRegionInfo(), plan.getDestination());
addToServers(plan.getDestination(), plan.getRegionInfo());
}
}
break;
@ -2078,6 +2079,10 @@ public class AssignmentManager extends ZooKeeperListener {
// Remove from the regionsMap
synchronized (this.regions) {
this.regions.remove(region);
Set<HRegionInfo> serverRegions = this.servers.get(server);
if (!serverRegions.remove(region)) {
LOG.warn("No " + region + " on " + server);
}
}
deleteClosingOrClosedNode(region);
}