[
https://issues.apache.org/jira/browse/HBASE-3681?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13009774#comment-13009774
]
Ted Yu commented on HBASE-3681:
-------------------------------
LoadBalancer currently doesn't have access to Configuration. That's why slop
config is passed from HMaster.
I will submit another patch which checks against sloppiness envelope. If any of
the servers is outside the envelope, the current balancing code will run. See
following:
{code}
float average = (float)numRegions / numServers; // for logging
int min = (int) Math.floor(average * (1 - slop));
if (min > 0) min -= 1;
int max = (int) Math.ceil(average * (1 + slop));
if(serversByLoad.lastKey().getLoad().getNumberOfRegions() <= max &&
serversByLoad.firstKey().getLoad().getNumberOfRegions() >= min) {
// Skipped because no server outside (min,max) range
LOG.info("Skipping load balancing. servers=" + numServers + " " +
"regions=" + numRegions + " average=" + average + " " +
"mostloaded=" +
serversByLoad.lastKey().getLoad().getNumberOfRegions() +
" leastloaded=" +
serversByLoad.firstKey().getLoad().getNumberOfRegions());
return null;
}
min = numRegions / numServers;
max = numRegions % numServers == 0 ? min : min + 1;
{code}
> Check the sloppiness of the region load before balancing
> --------------------------------------------------------
>
> Key: HBASE-3681
> URL: https://issues.apache.org/jira/browse/HBASE-3681
> Project: HBase
> Issue Type: Improvement
> Affects Versions: 0.90.1
> Reporter: Jean-Daniel Cryans
> Assignee: Ted Yu
> Fix For: 0.92.0
>
> Attachments: hbase-3681.txt
>
>
> Per our discussion at the hackathon today, it seems that it would be more
> helpful to add a sloppiness check before doing the normal balancing.
> The current situation is that the balancer always tries to get the region
> load even, meaning that there can be some very frequent regions movement.
> Setting the balancer to run less often (like every 4 hours) isn't much better
> since the load could get out of whack easily.
> This is why running the normal balancer frequently, but first checking for
> some sloppiness in the region load across the RS, seems like a more viable
> option.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira