diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java index 611a68a9afb..a5b6d45d999 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java @@ -1521,11 +1521,6 @@ public class AssignmentManager extends ZooKeeperListener { if (isDisabledorDisablingRegionInRIT(region)) { return; } - if (this.serverManager.isClusterShutdown()) { - LOG.info("Cluster shutdown is set; skipping assign of " + - region.getRegionNameAsString()); - return; - } String encodedName = region.getEncodedName(); Lock lock = locker.acquireLock(encodedName); try { @@ -3284,6 +3279,8 @@ public class AssignmentManager extends ZooKeeperListener { synchronized (zkEventWorkerWaitingList){ zkEventWorkerWaitingList.clear(); } + + // Shutdown the threadpool executor service threadPoolExecutorService.shutdownNow(); zkEventWorkers.shutdownNow(); regionStateStore.stop(); 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 221e2663c3a..946476cddbb 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 @@ -1647,18 +1647,16 @@ public class HMaster extends HRegionServer implements MasterServices, Server { LOG.error("Error call master coprocessor preShutdown()", ioe); } } - if (this.assignmentManager != null) { - this.assignmentManager.shutdown(); + + if (this.serverManager != null) { + this.serverManager.shutdownCluster(); } - try { - if (this.clusterStatusTracker != null){ + if (this.clusterStatusTracker != null){ + try { this.clusterStatusTracker.setClusterDown(); - if (this.serverManager != null) { - this.serverManager.shutdownCluster(); - } + } catch (KeeperException e) { + LOG.error("ZooKeeper exception trying to set cluster as down in ZK", e); } - } catch (KeeperException e) { - LOG.error("ZooKeeper exception trying to set cluster as down in ZK", e); } } diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java index d4f3d6dfe9f..88b8a1739fa 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java @@ -874,7 +874,7 @@ public class MasterRpcServices extends RSRpcServices public IsMasterRunningResponse isMasterRunning(RpcController c, IsMasterRunningRequest req) throws ServiceException { try { - master.checkInitialized(); + master.checkServiceStarted(); return IsMasterRunningResponse.newBuilder().setIsMasterRunning( !master.isStopped()).build(); } catch (IOException e) { diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java index 923523ffac2..1e31fa19153 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java @@ -671,7 +671,7 @@ public class HRegionServer extends HasThread implements * @return False if cluster shutdown in progress */ private boolean isClusterUp() { - return this.clusterStatusTracker.isClusterUp(); + return clusterStatusTracker != null && clusterStatusTracker.isClusterUp(); } private void initializeThreads() throws IOException {