HBASE-3283 NPE in AssignmentManager if processing shutdown of RS who doesn't have any regions assigned to it
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1040302 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
2778fced75
commit
8b693bf547
|
@ -9,6 +9,8 @@ Release 0.91.0 - Unreleased
|
|||
HBASE-3280 YouAreDeadException being swallowed in HRS getMaster
|
||||
HBASE-3282 Need to retain DeadServers to ensure we don't allow
|
||||
previously expired RS instances to rejoin cluster
|
||||
HBASE-3283 NPE in AssignmentManager if processing shutdown of RS who
|
||||
doesn't have any regions assigned to it
|
||||
|
||||
IMPROVEMENTS
|
||||
HBASE-2001 Coprocessors: Colocate user code with regions (Mingjie Lai via
|
||||
|
|
|
@ -1597,8 +1597,14 @@ public class AssignmentManager extends ZooKeeperListener {
|
|||
// Remove this server from map of servers to regions, and remove all regions
|
||||
// of this server from online map of regions.
|
||||
Set<HRegionInfo> deadRegions = null;
|
||||
List<HRegionInfo> rits = new ArrayList<HRegionInfo>();
|
||||
synchronized (this.regions) {
|
||||
deadRegions = new TreeSet<HRegionInfo>(this.servers.remove(hsi));
|
||||
List<HRegionInfo> assignedRegions = this.servers.remove(hsi);
|
||||
if (assignedRegions == null || assignedRegions.isEmpty()) {
|
||||
// No regions on this server, we are done, return empty list of RITs
|
||||
return rits;
|
||||
}
|
||||
deadRegions = new TreeSet<HRegionInfo>(assignedRegions);
|
||||
for (HRegionInfo region : deadRegions) {
|
||||
this.regions.remove(region);
|
||||
}
|
||||
|
@ -1606,7 +1612,6 @@ public class AssignmentManager extends ZooKeeperListener {
|
|||
// See if any of the regions that were online on this server were in RIT
|
||||
// If they are, normal timeouts will deal with them appropriately so
|
||||
// let's skip a manual re-assignment.
|
||||
List<HRegionInfo> rits = new ArrayList<HRegionInfo>();
|
||||
synchronized (regionsInTransition) {
|
||||
for (RegionState region : this.regionsInTransition.values()) {
|
||||
if (deadRegions.remove(region.getRegion())) {
|
||||
|
|
Loading…
Reference in New Issue