rmdmattingly commented on code in PR #6622:
URL: https://github.com/apache/hbase/pull/6622#discussion_r1930780063
##########
hbase-balancer/src/main/java/org/apache/hadoop/hbase/master/balancer/BalancerClusterState.java:
##########
@@ -446,6 +447,11 @@ private void registerRegion(RegionInfo region, int
regionIndex, int serverIndex,
: serversToIndex.get(loc.get(i).getAddress()));
}
}
+
+ int numReplicas = region.getReplicaId() + 1;
+ if (numReplicas > maxReplicas) {
+ maxReplicas = numReplicas;
+ }
Review Comment:
The BalancerClusterState is only aware of the regions for tables that it is
actively trying to balance — so if you're balancing by table (not the default)
then I believe table specific tracking will not make this any better. If you're
balancing by cluster (the default) then I believe table specific tracking could
_maybe_ make things better by checking for rack replica colocation by table...
actually now that I think about it the cost functions probably don't support
this. So, tldr, if you're doing cluster-wide balancing then this will cause us
to ignore rack colocation as a trigger once any single table's replica counts
are greater than the number of racks, and the way to get more specific
decisions would be to enable byTable balancing
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]