Index: src/main/java/org/apache/hadoop/hbase/master/HMaster.java =================================================================== --- src/main/java/org/apache/hadoop/hbase/master/HMaster.java (revision 1333288) +++ src/main/java/org/apache/hadoop/hbase/master/HMaster.java (working copy) @@ -577,8 +577,7 @@ // 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 @@ -648,6 +647,18 @@ } /** + * 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 -ROOT- and .META. are assigned. If not, * assign them. * @throws InterruptedException @@ -699,6 +710,7 @@ 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