hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jg...@apache.org
Subject svn commit: r1040301 - in /hbase/branches/0.90: CHANGES.txt src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
Date Mon, 29 Nov 2010 21:18:07 GMT
Author: jgray
Date: Mon Nov 29 21:18:04 2010
New Revision: 1040301

URL: http://svn.apache.org/viewvc?rev=1040301&view=rev
Log:
HBASE-3283 NPE in AssignmentManager if processing shutdown of RS who doesn't have any regions
assigned to it

Modified:
    hbase/branches/0.90/CHANGES.txt
    hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java

Modified: hbase/branches/0.90/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/CHANGES.txt?rev=1040301&r1=1040300&r2=1040301&view=diff
==============================================================================
--- hbase/branches/0.90/CHANGES.txt (original)
+++ hbase/branches/0.90/CHANGES.txt Mon Nov 29 21:18:04 2010
@@ -705,6 +705,8 @@ Release 0.90.0 - Unreleased
    HBASE-3267  close_region shell command breaks region
    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

Modified: hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java?rev=1040301&r1=1040300&r2=1040301&view=diff
==============================================================================
--- hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
(original)
+++ hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
Mon Nov 29 21:18:04 2010
@@ -1597,8 +1597,14 @@ public class AssignmentManager extends Z
     // 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 Z
     // 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())) {



Mime
View raw message