BukrosSzabolcs commented on a change in pull request #2057:
URL: https://github.com/apache/hbase/pull/2057#discussion_r454322908



##########
File path: 
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMetaWithReplicasBasic.java
##########
@@ -80,6 +83,27 @@ public void testZookeeperNodesForReplicas() throws Exception 
{
     }
   }
 
+  @Test
+  public void testReplicaCleanup() throws Exception {
+    ZKWatcher zkw = TEST_UTIL.getZooKeeperWatcher();
+    List<String> metaReplicaZnodes = zkw.getMetaReplicaNodes();
+    assertEquals(metaReplicaZnodes.size(), 3);

Review comment:
       Switched

##########
File path: 
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMetaWithReplicasBasic.java
##########
@@ -80,6 +83,27 @@ public void testZookeeperNodesForReplicas() throws Exception 
{
     }
   }
 
+  @Test
+  public void testReplicaCleanup() throws Exception {
+    ZKWatcher zkw = TEST_UTIL.getZooKeeperWatcher();
+    List<String> metaReplicaZnodes = zkw.getMetaReplicaNodes();
+    assertEquals(metaReplicaZnodes.size(), 3);
+
+    final HMaster master = TEST_UTIL.getMiniHBaseCluster().getMaster();
+    master.stop("Restarting");
+    TEST_UTIL.waitFor(30000, () -> master.isStopped());
+    
TEST_UTIL.getMiniHBaseCluster().getConfiguration().setInt(HConstants.META_REPLICAS_NUM,
 1);
+
+    JVMClusterUtil.MasterThread newMasterThread = 
TEST_UTIL.getMiniHBaseCluster().startMaster();
+    final HMaster newMaster = newMasterThread.getMaster();
+
+    //wait until new master finished meta replica assignment logic
+    TEST_UTIL.waitFor(30000, () -> newMaster.getMasterQuotaManager() != null);
+    zkw = TEST_UTIL.getZooKeeperWatcher();
+    metaReplicaZnodes = zkw.getMetaReplicaNodes();
+    assertEquals(metaReplicaZnodes.size(), 1);

Review comment:
       Switched




----------------------------------------------------------------
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


Reply via email to