hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jxi...@apache.org
Subject svn commit: r1558965 - in /hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/master: AssignmentManager.java HMaster.java
Date Fri, 17 Jan 2014 00:18:24 GMT
Author: jxiang
Date: Fri Jan 17 00:18:23 2014
New Revision: 1558965

URL: http://svn.apache.org/r1558965
Log:
HBASE-10333 Assignments are not retained on a cluster start

Modified:
    hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
    hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java

Modified: hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java?rev=1558965&r1=1558964&r2=1558965&view=diff
==============================================================================
--- hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
(original)
+++ hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
Fri Jan 17 00:18:23 2014
@@ -633,17 +633,19 @@ public class AssignmentManager extends Z
       }
       // Put it back in transition so that SSH can re-assign it
       regionStates.updateRegionState(regionInfo, State.OFFLINE, sn);
-      // No mater the previous server is online or offline,
-      // we need to reset the last region server of the region.
-      regionStates.setLastRegionServerOfRegion(sn, encodedName);
+
       if (regionInfo.isMetaRegion()) {
         // If it's meta region, reset the meta location.
         // So that master knows the right meta region server.
         MetaRegionTracker.setMetaLocation(watcher, sn);
-      }
-      // Make sure we know the server is dead.
-      if (!serverManager.isServerDead(sn)) {
-        serverManager.expireServer(sn);
+      } else {
+        // No matter the previous server is online or offline,
+        // we need to reset the last region server of the region.
+        regionStates.setLastRegionServerOfRegion(sn, encodedName);
+        // Make sure we know the server is dead.
+        if (!serverManager.isServerDead(sn)) {
+          serverManager.expireServer(sn);
+        }
       }
       return false;
     }

Modified: hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java?rev=1558965&r1=1558964&r2=1558965&view=diff
==============================================================================
--- hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
(original)
+++ hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
Fri Jan 17 00:18:23 2014
@@ -1006,16 +1006,23 @@ MasterServices, Server {
       assigned++;
       if (!rit) {
         // Assign meta since not already in transition
-        if (!serverManager.isServerDead(currentMetaServer)) {
-          LOG.info("Forcing expire of " + currentMetaServer);
-          serverManager.expireServer(currentMetaServer);
+        if (currentMetaServer != null) {
+          // If the meta server is not known to be dead or online,
+          // just split the meta log, and don't expire it since this
+          // could be a full cluster restart. Otherwise, we will think
+          // this is a failover and lose previous region locations.
+          // If it is really a failover case, AM will find out in rebuilding
+          // user regions. Otherwise, we are good since all logs are split
+          // or known to be replayed before user regions are assigned.
+          if (serverManager.isServerOnline(currentMetaServer)) {
+            LOG.info("Forcing expire of " + currentMetaServer);
+            serverManager.expireServer(currentMetaServer);
+          }
           splitMetaLogBeforeAssignment(currentMetaServer);
           if (this.distributedLogReplay) {
             logReplayFailedMetaServer = currentMetaServer;
           }
         }
-        // Make sure assignment manager knows where the meta is,
-        // so that meta sever shutdown handler kicks in.
         assignmentManager.assignMeta();
       }
     } else {



Mime
View raw message