hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject git commit: HBASE-11988 AC/VC system table create on postStartMaster fails too often in test; ADD DEBUG
Date Tue, 16 Sep 2014 23:32:17 GMT
Repository: hbase
Updated Branches:
  refs/heads/master e1f8a325f -> fc97a1b34


HBASE-11988 AC/VC system table create on postStartMaster fails too often in test; ADD DEBUG


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

Branch: refs/heads/master
Commit: fc97a1b34c9cd9d5c18758b31712b6e0fe99ac9c
Parents: e1f8a32
Author: stack <stack@apache.org>
Authored: Tue Sep 16 16:31:57 2014 -0700
Committer: stack <stack@apache.org>
Committed: Tue Sep 16 16:32:11 2014 -0700

----------------------------------------------------------------------
 .../hbase/master/TableNamespaceManager.java      | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/fc97a1b3/hbase-server/src/main/java/org/apache/hadoop/hbase/master/TableNamespaceManager.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/TableNamespaceManager.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/TableNamespaceManager.java
index 8ad0d1a..a930251 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/TableNamespaceManager.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/TableNamespaceManager.java
@@ -74,7 +74,7 @@ public class TableNamespaceManager {
   private boolean initialized;
 
   static final String NS_INIT_TIMEOUT = "hbase.master.namespace.init.timeout";
-  static final int DEFAULT_NS_INIT_TIMEOUT = 60000;
+  static final int DEFAULT_NS_INIT_TIMEOUT = 300000;
 
   public TableNamespaceManager(MasterServices masterServices) {
     this.masterServices = masterServices;
@@ -83,7 +83,7 @@ public class TableNamespaceManager {
 
   public void start() throws IOException {
     if (!MetaTableAccessor.tableExists(masterServices.getShortCircuitConnection(),
-      TableName.NAMESPACE_TABLE_NAME)) {
+        TableName.NAMESPACE_TABLE_NAME)) {
       LOG.info("Namespace table not found. Creating...");
       createNamespaceTable(masterServices);
     }
@@ -94,10 +94,11 @@ public class TableNamespaceManager {
       // So that it should be initialized later on lazily.
       long startTime = EnvironmentEdgeManager.currentTime();
       int timeout = conf.getInt(NS_INIT_TIMEOUT, DEFAULT_NS_INIT_TIMEOUT);
-      while (!isTableAssigned()) {
+      while (!(isTableAssigned() && isTableEnabled())) {
         if (EnvironmentEdgeManager.currentTime() - startTime + 100 > timeout) {
-          LOG.warn("Timedout waiting for namespace table to be assigned.");
-          return;
+          // We can't do anything if ns is not online.
+          throw new IOException("Timedout " + timeout + "ms waiting for namespace table to
" +
+            "be assigned and enabled: " + getTableState());
         }
         Thread.sleep(100);
       }
@@ -299,10 +300,12 @@ public class TableNamespaceManager {
     return false;
   }
 
+  private TableState.State getTableState() throws IOException {
+    return masterServices.getTableStateManager().getTableState(TableName.NAMESPACE_TABLE_NAME);
+  }
+
   private boolean isTableEnabled() throws IOException {
-    return masterServices.getTableStateManager().getTableState(
-            TableName.NAMESPACE_TABLE_NAME
-    ).equals(TableState.State.ENABLED);
+    return getTableState().equals(TableState.State.ENABLED);
   }
 
   private boolean isTableAssigned() {


Mime
View raw message