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 2021/01/19 02:41:04 UTC

[GitHub] [hbase] ZhaoBQ commented on a change in pull request #2887: HBASE-25513 When the table is turned on normalize, the first region may not be merged even the size is 0

ZhaoBQ commented on a change in pull request #2887:
URL: https://github.com/apache/hbase/pull/2887#discussion_r559879732



##########
File path: hbase-server/src/test/java/org/apache/hadoop/hbase/master/normalizer/TestSimpleRegionNormalizer.java
##########
@@ -448,6 +448,38 @@ public void testMergeEmptyRegions1() {
         .build()));
   }
 
+  @Test
+  public void testMergeEmptyRegions2() {
+    conf.setBoolean(SPLIT_ENABLED_KEY, false);
+    conf.setInt(MERGE_MIN_REGION_SIZE_MB_KEY, 0);
+    final TableName tableName = name.getTableName();
+    final List<RegionInfo> regionInfos = createRegionInfos(tableName, 8);
+    final Map<byte[], Integer> regionSizes =
+      createRegionSizesMap(regionInfos, 0, 10, 1, 0, 9, 0, 10, 0);
+    setupMocksForNormalizer(regionSizes, regionInfos);
+
+    assertFalse(normalizer.isSplitEnabled());
+    assertEquals(0, normalizer.getMergeMinRegionSizeMb());
+    List<NormalizationPlan> plans = normalizer.computePlansForTable(tableName);
+    assertThat(plans, contains(
+      new MergeNormalizationPlan.Builder()

Review comment:
       Without source code changes, the first pair would be {1, 0}, because 10 is bigger than avgSize.




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