This is an automated email from the ASF dual-hosted git repository. psomogyi pushed a commit to branch branch-2.2 in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/branch-2.2 by this push: new dc1eaf3 HBASE-25523 Region normalizer chore thread is getting killed (#2911) dc1eaf3 is described below commit dc1eaf3a02ad9bf6b24d5ccf8c6b86ff73c6aece Author: Peter Somogyi <psomo...@apache.org> AuthorDate: Fri Jan 29 19:04:41 2021 +0100 HBASE-25523 Region normalizer chore thread is getting killed (#2911) Signed-off-by: Viraj Jasani <vjas...@apache.org> --- .../hbase/master/normalizer/SimpleRegionNormalizer.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) 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 d20ba70..acc38eb 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 @@ -25,6 +25,7 @@ import java.util.Comparator; import java.util.List; import org.apache.hadoop.hbase.HBaseIOException; import org.apache.hadoop.hbase.RegionMetrics; +import org.apache.hadoop.hbase.ServerMetrics; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.Size; import org.apache.hadoop.hbase.TableName; @@ -252,8 +253,16 @@ public class SimpleRegionNormalizer implements RegionNormalizer { private long getRegionSize(RegionInfo hri) { ServerName sn = masterServices.getAssignmentManager().getRegionStates(). getRegionServerOfRegion(hri); - RegionMetrics regionLoad = masterServices.getServerManager().getLoad(sn). - getRegionMetrics().get(hri.getRegionName()); + if (sn == null) { + LOG.debug("{} region was not found on any Server", hri.getRegionNameAsString()); + return -1; + } + ServerMetrics serverMetrics = masterServices.getServerManager().getLoad(sn); + if (serverMetrics == null) { + LOG.debug("server {} was not found in ServerManager", sn.getServerName()); + return -1; + } + RegionMetrics regionLoad = serverMetrics.getRegionMetrics().get(hri.getRegionName()); if (regionLoad == null) { LOG.debug(hri.getRegionNameAsString() + " was not found in RegionsLoad"); return -1;