[ 
https://issues.apache.org/jira/browse/HBASE-26309?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17423416#comment-17423416
 ] 

Clara Xiong commented on HBASE-26309:
-------------------------------------

When balancer has to satisfy other constraints, even region count distribution 
just cannot be guaranteed, as in existing test case 
TestStochasticLoadBalancerRegionReplicaWithRacks. Because replica distribution 
has much higher weight than region count skew, the rack with fewer servers tend 
to get more regions than those with more servers.

In this test case, server 0 and 1 are on the same rack while 2 and 3 are on 
each's rack because servers cannot be place completely evenly. The resulted 
region count distribution can be [2,2, 4, 4] or be[1, 3, 4, 4]so that we have 
no replicas of the same region on the first rack. So we have to have fewer 
regions per server on the first two servers. With the current algorithm, the 
costs of two plan are the same for region count skew because only linear 
deviation to ideal average is considered. It can get much more extreme when we 
have 8 servers for this test case: [1,3,3,3,5]or [2,2,3,3,5] depending on the 
random walk. But since the algorithm says they are the same expense for region 
count skew, balancer can be stuck at the former. The more servers we have, as 
long as the RS counts are not completely even, which happens all the time, the 
more variation of results we will see depending the random walk. But once we 
reach the extreme case, balancer is stuck because the cost function says moving 
doesn't gain.

I am proposing using the sum of square of deviation for load functions, inline 
with replica cost functions. we don't need standard deviation so we can keep it 
simple and fast.

> Balancer tends to move regions to the server at the end of list
> ---------------------------------------------------------------
>
>                 Key: HBASE-26309
>                 URL: https://issues.apache.org/jira/browse/HBASE-26309
>             Project: HBase
>          Issue Type: Improvement
>          Components: Balancer
>            Reporter: Clara Xiong
>            Assignee: Clara Xiong
>            Priority: Major
>
> When we have cohosted replicas, cohosted replica distribution has priority to 
> region count skew. So we won't see region count  getting balanced until the 
> replicas distributed. During this time, master UI shows a drift of regions to 
> the server at the end of list and causes significant overload. This shows a 
> bias of random region pick and needs to be addressed.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to