diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java index 3f13a45c360..18de2fdf796 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java @@ -845,11 +845,6 @@ public class HMaster extends HRegionServer implements MasterServices { */ private void finishActiveMasterInitialization(MonitoredTask status) throws IOException, InterruptedException, KeeperException, ReplicationException { - Thread zombieDetector = new Thread(new InitializationMonitor(this), - "ActiveMasterInitializationMonitor-" + System.currentTimeMillis()); - zombieDetector.setDaemon(true); - zombieDetector.start(); - /* * We are active master now... go initialize components we need to run. */ @@ -919,6 +914,12 @@ public class HMaster extends HRegionServer implements MasterServices { // Set ourselves as active Master now our claim has succeeded up in zk. this.activeMaster = true; + // Start the Zombie master detector after setting master as active, see HBASE-21535 + Thread zombieDetector = new Thread(new InitializationMonitor(this), + "ActiveMasterInitializationMonitor-" + System.currentTimeMillis()); + zombieDetector.setDaemon(true); + zombieDetector.start(); + // This is for backwards compatibility // See HBASE-11393 status.setStatus("Update TableCFs node in ZNode");