From 72dc6fe5d531d55a3b09449396d2f04e7eb9c461 Mon Sep 17 00:00:00 2001 From: tedyu Date: Thu, 2 Jun 2016 09:29:57 -0700 Subject: [PATCH] HBASE-15933 Addendum - make merge decision when sizes of both regions are known --- .../hadoop/hbase/master/normalizer/SimpleRegionNormalizer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/normalizer/SimpleRegionNormalizer.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/normalizer/SimpleRegionNormalizer.java index a2202ad1d6e..f57ded15aa0 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/normalizer/SimpleRegionNormalizer.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/normalizer/SimpleRegionNormalizer.java @@ -170,7 +170,7 @@ public class SimpleRegionNormalizer implements RegionNormalizer { if (mergeEnabled) { HRegionInfo hri2 = tableRegions.get(candidateIdx+1); long regionSize2 = getRegionSize(hri2); - if (regionSize + regionSize2 < avgRegionSize) { + if (regionSize > 0 && regionSize2 > 0 && regionSize + regionSize2 < avgRegionSize) { LOG.info("Table " + table + ", small region size: " + regionSize + " plus its neighbor size: " + regionSize2 + ", less than the avg size " + avgRegionSize + ", merging them");