You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2014/09/20 05:58:04 UTC

git commit: HBASE-11988 AC/VC system table create on postStartMaster fails too often in test

Repository: hbase
Updated Branches:
  refs/heads/branch-1 1c127220f -> 22320eeba


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


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

Branch: refs/heads/branch-1
Commit: 22320eeba01b38c920871afd183b09baeb0e27d2
Parents: 1c12722
Author: stack <st...@apache.org>
Authored: Fri Sep 19 20:57:44 2014 -0700
Committer: stack <st...@apache.org>
Committed: Fri Sep 19 20:57:59 2014 -0700

----------------------------------------------------------------------
 .../hadoop/hbase/master/TableNamespaceManager.java     | 13 +++++++------
 .../org/apache/hadoop/hbase/HBaseTestingUtility.java   |  3 +--
 2 files changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/22320eeb/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 a78e225..e95a2bb 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
@@ -73,7 +73,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;
@@ -82,7 +82,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);
     }
@@ -95,8 +95,9 @@ public class TableNamespaceManager {
       int timeout = conf.getInt(NS_INIT_TIMEOUT, DEFAULT_NS_INIT_TIMEOUT);
       while (!isTableAssigned()) {
         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");
         }
         Thread.sleep(100);
       }
@@ -299,7 +300,7 @@ public class TableNamespaceManager {
   }
 
   private boolean isTableAssigned() {
-    return !masterServices.getAssignmentManager()
-        .getRegionStates().getRegionsOfTable(TableName.NAMESPACE_TABLE_NAME).isEmpty();
+    return !masterServices.getAssignmentManager().getRegionStates().
+      getRegionsOfTable(TableName.NAMESPACE_TABLE_NAME).isEmpty();
   }
 }

http://git-wip-us.apache.org/repos/asf/hbase/blob/22320eeb/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java
index f7c4711..2538e74 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java
@@ -2718,11 +2718,10 @@ public class HBaseTestingUtility extends HBaseCommonTestingUtility {
     TableName tableName = TableName.valueOf(table);
     long startWait = System.currentTimeMillis();
     waitTableAvailable(admin, table, timeoutMillis);
-    long remainder = System.currentTimeMillis() - startWait;
     while (!admin.isTableEnabled(tableName)) {
       assertTrue("Timed out waiting for table to become available and enabled " +
          Bytes.toStringBinary(table),
-         System.currentTimeMillis() - remainder < timeoutMillis);
+         System.currentTimeMillis() - startWait < timeoutMillis);
       Thread.sleep(200);
     }
     // Finally make sure all regions are fully open and online out on the cluster. Regions may be