hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ramkris...@apache.org
Subject svn commit: r1354634 - /hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
Date Wed, 27 Jun 2012 17:14:11 GMT
Author: ramkrishna
Date: Wed Jun 27 17:14:09 2012
New Revision: 1354634

URL: http://svn.apache.org/viewvc?rev=1354634&view=rev
Log:
HBASE-6227 SSH and cluster startup causes data loss

Submitted by:Chunhui	
Reviewed by:Ram, Ted	

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=1354634&r1=1354633&r2=1354634&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
Wed Jun 27 17:14:09 2012
@@ -447,6 +447,13 @@ public class AssignmentManager extends Z
     // no lock concurrent access ok: some threads may be adding/removing items but its java-valid
     nodes.removeAll(regionsInTransition.keySet());
 
+    // If some dead servers are processed by ServerShutdownHandler, we shouldn't
+    // assign all user regions( some would be assigned by
+    // ServerShutdownHandler), consider it as a failover
+    if (!this.serverManager.getDeadServers().isEmpty()) {
+      this.failover = true;
+    }
+
     // If we found user regions out on cluster, its a failover.
     if (this.failover) {
       LOG.info("Found regions out on cluster or in RIT; failover");
@@ -2811,6 +2818,9 @@ public class AssignmentManager extends Z
       // skip regions of dead servers because SSH will process regions during rs expiration.

       // see HBASE-5916
       if (actualDeadServers.contains(deadServer.getKey())) {
+        for (Pair<HRegionInfo, Result> deadRegion : deadServer.getValue()) {
+          nodes.remove(deadRegion.getFirst().getEncodedName());
+        }
         continue;
       }
       List<Pair<HRegionInfo, Result>> regions = deadServer.getValue();



Mime
View raw message