hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject svn commit: r1373829 - /hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
Date Thu, 16 Aug 2012 13:39:54 GMT
Author: tedyu
Date: Thu Aug 16 13:39:53 2012
New Revision: 1373829

URL: http://svn.apache.org/viewvc?rev=1373829&view=rev
Log:
HBASE-6587 Region would be assigned twice in the case of all RS offline (Chunhui)


Modified:
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java?rev=1373829&r1=1373828&r2=1373829&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
(original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
Thu Aug 16 13:39:53 2012
@@ -2811,11 +2811,19 @@ public class AssignmentManager extends Z
       // no lock concurrent access ok: we will be working on a copy, and it's java-valid
to do
       //  a copy while another thread is adding/removing items
       for (RegionState regionState : regionStates.getRegionsInTransition().values()) {
-        if (regionState.getStamp() + timeout <= now ||
-          (this.allRegionServersOffline && !noRSAvailable)) {
-          //decide on action upon timeout or, if some RSs just came back online, we can start
the
-          // the assignment
+        if (regionState.getStamp() + timeout <= now) {
+          // decide on action upon timeout
           actOnTimeOut(regionState);
+        } else if (this.allRegionServersOffline && !noRSAvailable) {
+          RegionPlan existingPlan = regionPlans.get(regionState.getRegion()
+              .getEncodedName());
+          if (existingPlan == null
+              || !this.serverManager.isServerOnline(existingPlan
+                  .getDestination())) {
+            // if some RSs just came back online, we can start the assignment
+            // right away
+            actOnTimeOut(regionState);
+          }
         }
       }
       setAllRegionServersOffline(noRSAvailable);



Mime
View raw message