You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by GitBox <gi...@apache.org> on 2020/07/13 17:46:42 UTC

[GitHub] [hbase] petersomogyi commented on a change in pull request #2057: HBASE-24720: Meta replicas not cleaned when disabled

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



##########
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:
       The parameter order for assertEquals should be 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);

Review comment:
       The parameter order for assertEquals should be 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:
users@infra.apache.org