bharathv commented on a change in pull request #995: HBASE-23055 Alter 
hbase:meta
URL: https://github.com/apache/hbase/pull/995#discussion_r364417370
 
 

 ##########
 File path: 
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestZKAsyncRegistry.java
 ##########
 @@ -128,4 +130,42 @@ public void testNoMetaAvailable() throws 
InterruptedException {
       }
     }
   }
+
+  /**
+   * Test meta tablestate implementation.
+   * Test is a bit involved because meta has replicas... Replica assign lags 
so check
+   * between steps all assigned.
+   */
+  @Test
+  public void testMetaTableState() throws IOException, ExecutionException, 
InterruptedException {
+    assertTrue(TEST_UTIL.getMiniHBaseCluster().getMaster().isActiveMaster());
+    while (!TEST_UTIL.getMiniHBaseCluster().getMaster().isInitialized()) {
+      Threads.sleep(10);
+    }
+    while (TEST_UTIL.getMiniHBaseCluster().getMaster().getAssignmentManager().
+        hasRegionsInTransition()) {
+      Threads.sleep(10);
+    }
+    LOG.info("MASTER INITIALIZED");
+    try (ZKAsyncRegistry registry = new 
ZKAsyncRegistry(TEST_UTIL.getConfiguration())) {
+      assertEquals(TableState.State.ENABLED, 
registry.getMetaTableState().get().getState());
+      LOG.info("META ENABLED");
+      try (Admin admin = TEST_UTIL.getConnection().getAdmin()) {
+        admin.disableTable(TableName.META_TABLE_NAME);
+        assertEquals(TableState.State.DISABLED, 
registry.getMetaTableState().get().getState());
+        while 
(TEST_UTIL.getMiniHBaseCluster().getMaster().getAssignmentManager().
+          hasRegionsInTransition()) {
+          Threads.sleep(10);
+        }
+        LOG.info("META DISABLED");
+        admin.enableTable(TableName.META_TABLE_NAME);
+        assertEquals(TableState.State.ENABLED, 
registry.getMetaTableState().get().getState());
+        while 
(TEST_UTIL.getMiniHBaseCluster().getMaster().getAssignmentManager().
 
 Review comment:
   same.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to