hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ramkris...@apache.org
Subject svn commit: r1354635 - /hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
Date Wed, 27 Jun 2012 17:15:28 GMT
Author: ramkrishna
Date: Wed Jun 27 17:15:27 2012
New Revision: 1354635

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

Submitted by:Chunhui	
Reviewed by:Ted, Ram	

Modified:
    hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java

Modified: hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java?rev=1354635&r1=1354634&r2=1354635&view=diff
==============================================================================
--- hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
(original)
+++ hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
Wed Jun 27 17:15:27 2012
@@ -412,6 +412,13 @@ public class AssignmentManager extends Z
       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");
@@ -2671,6 +2678,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