diff --git a/CHANGES.txt b/CHANGES.txt index 1d274990a13..eae17ae9baa 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -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 diff --git a/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java b/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java index a3c9c89976e..6811cdc6438 100644 --- a/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java +++ b/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java @@ -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 deadRegions = null; + List rits = new ArrayList(); synchronized (this.regions) { - deadRegions = new TreeSet(this.servers.remove(hsi)); + List 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(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 rits = new ArrayList(); synchronized (regionsInTransition) { for (RegionState region : this.regionsInTransition.values()) { if (deadRegions.remove(region.getRegion())) {