You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by ra...@apache.org on 2012/06/20 19:44:37 UTC
svn commit: r1352229 -
/hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
Author: ramkrishna
Date: Wed Jun 20 17:44:36 2012
New Revision: 1352229
URL: http://svn.apache.org/viewvc?rev=1352229&view=rev
Log:
HBASE-5918 Master will block forever at startup if root server dies between assigning root and assigning meta
Submitted by:Chunhui
Reviewed by:Stack, Ted, Ram
Modified:
hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
Modified: hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/master/HMaster.java?rev=1352229&r1=1352228&r2=1352229&view=diff
==============================================================================
--- hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/master/HMaster.java (original)
+++ hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/master/HMaster.java Wed Jun 20 17:44:36 2012
@@ -527,8 +527,7 @@ Server {
// Make sure root and meta assigned before proceeding.
assignRootAndMeta(status);
- 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
@@ -580,6 +579,19 @@ 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();
+ }
+ }
+
+ /**
* Useful for testing purpose also where we have
* master restart scenarios.
*/
@@ -644,6 +656,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