virajjasani commented on a change in pull request #2899:
URL: https://github.com/apache/hbase/pull/2899#discussion_r562404352



##########
File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/master/normalizer/SimpleRegionNormalizer.java
##########
@@ -222,8 +223,12 @@ public void setMasterRpcServices(MasterRpcServices 
masterRpcServices) {
   private long getRegionSize(HRegionInfo hri) {
     ServerName sn = masterServices.getAssignmentManager().getRegionStates().
       getRegionServerOfRegion(hri);
-    RegionLoad regionLoad = masterServices.getServerManager().getLoad(sn).
-      getRegionsLoad().get(hri.getRegionName());
+    ServerLoad load = masterServices.getServerManager().getLoad(sn);
+    if (load == null) {
+      LOG.debug(hri.getRegionNameAsString() + " was not found on any server");

Review comment:
       @bharathv you are right about RITs. Default behaviour of balancer is 
also to not execute when the cluster has RITs, only by providing a `force` 
option does it allow using balancer forcefully in the presence of RITs. 
Something similar (if not already in place) should be applicable to normalizer 
too.
   
   Moreover, I just checked, this change should be applicable to master and 
branch-2's also. I think we can start with master branch PR, continue 
discussion, finalize changes there and then come back here while backporting.

##########
File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/master/normalizer/SimpleRegionNormalizer.java
##########
@@ -222,8 +223,12 @@ public void setMasterRpcServices(MasterRpcServices 
masterRpcServices) {
   private long getRegionSize(HRegionInfo hri) {
     ServerName sn = masterServices.getAssignmentManager().getRegionStates().
       getRegionServerOfRegion(hri);
-    RegionLoad regionLoad = masterServices.getServerManager().getLoad(sn).
-      getRegionsLoad().get(hri.getRegionName());
+    ServerLoad load = masterServices.getServerManager().getLoad(sn);
+    if (load == null) {
+      LOG.debug(hri.getRegionNameAsString() + " was not found on any server");

Review comment:
       > Doesn't this mean the server "sn" is offline (not that region is not 
assigned)?
   
   True, most likely this would mean that region is in transition because RS 
hosting this region went offline.




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