hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject svn commit: r1352161 - /hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
Date Wed, 20 Jun 2012 15:33:40 GMT
Author: tedyu
Date: Wed Jun 20 15:33:40 2012
New Revision: 1352161

URL: http://svn.apache.org/viewvc?rev=1352161&view=rev
Log:
HBASE-5918 Master will block forever at startup if root server dies between assigning root
and assigning meta (Chunhui)


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

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java?rev=1352161&r1=1352160&r2=1352161&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java (original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java Wed
Jun 20 15:33:40 2012
@@ -635,8 +635,7 @@ Server {
 
     // Make sure root and meta assigned before proceeding.
     if (!assignRootAndMeta(status)) return;
-    serverShutdownHandlerEnabled = true;
-    this.serverManager.expireDeadNotExpiredServers();
+    enableServerShutdownHandler();
 
     // Update meta with new HRI if required. i.e migrate all HRI with HTD to
     // HRI with out HTD in meta and update the status in ROOT. This must happen
@@ -720,6 +719,18 @@ Server {
   }
 
   /**
+   * If ServerShutdownHandler is disabled, we enable it and expire those dead
+   * but not expired servers.
+   * @throws IOException
+   */
+  private void enableServerShutdownHandler() throws IOException {
+    if (!serverShutdownHandlerEnabled) {
+      serverShutdownHandlerEnabled = true;
+      this.serverManager.expireDeadNotExpiredServers();
+    }
+  }
+
+  /**
    * Check <code>-ROOT-</code> and <code>.META.</code> are assigned.
 If not,
    * assign them.
    * @throws InterruptedException
@@ -771,6 +782,7 @@ Server {
         splitLogAndExpireIfOnline(currentMetaServer);
       }
       assignmentManager.assignMeta();
+      enableServerShutdownHandler();
       this.catalogTracker.waitForMeta();
       // Above check waits for general meta availability but this does not
       // guarantee that the transition has completed



Mime
View raw message