hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jxi...@apache.org
Subject git commit: HBASE-11709 TestMasterShutdown can fail sometime
Date Tue, 12 Aug 2014 17:30:34 GMT
Repository: hbase
Updated Branches:
  refs/heads/master fadb0900a -> 9abe2da9e


HBASE-11709 TestMasterShutdown can fail sometime


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/9abe2da9
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/9abe2da9
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/9abe2da9

Branch: refs/heads/master
Commit: 9abe2da9e80b83ca41f9789bbb0a269631492b6b
Parents: fadb090
Author: Jimmy Xiang <jxiang@cloudera.com>
Authored: Fri Aug 8 10:10:28 2014 -0700
Committer: Jimmy Xiang <jxiang@cloudera.com>
Committed: Tue Aug 12 09:55:20 2014 -0700

----------------------------------------------------------------------
 .../hadoop/hbase/master/AssignmentManager.java      | 13 +------------
 .../org/apache/hadoop/hbase/master/HMaster.java     | 16 +++++++---------
 .../hadoop/hbase/master/MasterRpcServices.java      |  2 +-
 .../hadoop/hbase/regionserver/HRegionServer.java    |  2 +-
 4 files changed, 10 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/9abe2da9/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
----------------------------------------------------------------------
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 1b7aea0..0503c5c 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
@@ -644,11 +644,6 @@ public class AssignmentManager {
     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 {
@@ -2089,13 +2084,7 @@ public class AssignmentManager {
   }
 
   public void stop() {
-    shutdown(); // Stop executor service, etc
-  }
-
-  /**
-   * Shutdown the threadpool executor service
-   */
-  public void shutdown() {
+    // Shutdown the threadpool executor service
     threadPoolExecutorService.shutdownNow();
     regionStateStore.stop();
   }

http://git-wip-us.apache.org/repos/asf/hbase/blob/9abe2da9/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
----------------------------------------------------------------------
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 0c87e63..eca5999 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
@@ -1632,18 +1632,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);
     }
   }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/9abe2da9/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java
----------------------------------------------------------------------
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 d6f825b..f0309a2 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) {

http://git-wip-us.apache.org/repos/asf/hbase/blob/9abe2da9/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
----------------------------------------------------------------------
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 24bb09a..8e62620 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
@@ -670,7 +670,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 {


Mime
View raw message