ndimiduk commented on a change in pull request #2596:
URL: https://github.com/apache/hbase/pull/2596#discussion_r658109266



##########
File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/master/normalizer/SimpleRegionNormalizer.java
##########
@@ -315,35 +316,60 @@ private boolean skipForMerge(final RegionStates 
regionStates, final RegionInfo r
    * towards target average or target region count.
    */
   private List<NormalizationPlan> computeMergeNormalizationPlans(final 
NormalizeContext ctx) {
-    if (ctx.getTableRegions().size() < minRegionCount) {
+    if (isEmpty(ctx.getTableRegions()) || ctx.getTableRegions().size() < 
minRegionCount) {
       LOG.debug("Table {} has {} regions, required min number of regions for 
normalizer to run"
         + " is {}, not computing merge plans.", ctx.getTableName(), 
ctx.getTableRegions().size(),
         minRegionCount);
       return Collections.emptyList();
     }
 
-    final double avgRegionSizeMb = ctx.getAverageRegionSizeMb();
+    final long avgRegionSizeMb = (long) ctx.getAverageRegionSizeMb();
+    if (avgRegionSizeMb < mergeMinRegionSizeMb) {

Review comment:
       I haven't done a JIRA/git audit recently, but the normalizer on master 
and branch-2 should be identical. branch-2.4 has most of the big improvements 
that I'm aware of, including support for rate-limiting.
   
   Be advised that its settings for merging are still very coarse. I've been 
using it recently on large tables containing large regions and find that the 
2x-off-average is not practical. It needs more tuning and possibly new settings 
in order to work well in a large ranges of table topologies.
   
   Depending on how old of an HBase you're targeting, there was a bug where it 
would always force-merge, which could cause errors in meta. I advise against 
running normalizer before 2.3.




-- 
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:
[email protected]


Reply via email to