lfrancke commented on a change in pull request #2596:
URL: https://github.com/apache/hbase/pull/2596#discussion_r657856775
##########
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:
Thank you Nick for the prompt response. Much appreciated!
This is not really the place for it but I've been working on a backport of
the HBase 3 normalizer to an old version over here
https://github.com/opencore/hbase-normalizer which includes a few other
improvements. The work was triggered because the current Normalizer doesn't
consider a minimum size when splitting (unless I'm completely mistaken). For
various bad reasons we had tens of thousands of regions with an average size of
7 MB or so. Which means even a 14MB region (twice the average) would be split
leading to even more regions etc. so we introduced customizable multipliers and
minimum size for splits.
Your context helps. I hope to have the time to contribute these changes back.
--
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]