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

mazhengxuan commented on HBASE-30303:
-------------------------------------

I have submitted a fix in https://github.com/apache/hbase/pull/8519.
 
The patch makes correctAssignments use the same effective candidate-server 
logic as region assignment. It first uses the online servers from the table's 
target RSGroup. If the target group has no online servers and fallback is 
enabled, it uses the fallback candidates instead.
 
I also extended TestRSGroupsFallback to verify that repeated balance runs 
calculate no moves when regions are hosted on:
 
1. the default RSGroup after the original group becomes unavailable;
2. another available RSGroup after the default group also becomes unavailable.
 
The following tests passed:
 
{code:bash}
mvn -pl hbase-server \
-am \
-Dtest=org.apache.hadoop.hbase.rsgroup.TestRSGroupsFallback \
-Dsurefire.failIfNoSpecifiedTests=false \
test

mvn -pl hbase-server \
-am \
-Dtest=org.apache.hadoop.hbase.master.balancer.TestRSGroupBasedLoadBalancer \
-Dsurefire.failIfNoSpecifiedTests=false \
test
{code}
 
Please take a look when you have time. Thanks!

> Regions can not balance when enable rsgroup fallback and all regionservers 
> dead in one group
> --------------------------------------------------------------------------------------------
>
>                 Key: HBASE-30303
>                 URL: https://issues.apache.org/jira/browse/HBASE-30303
>             Project: HBase
>          Issue Type: Bug
>          Components: Balancer
>    Affects Versions: 2.6.6
>            Reporter: chaijunjie
>            Assignee: mazhengxuan
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: HBASE-30303.png
>
>
> With RSGroup fallback enabled, a table may belong to an RSGroup that has no 
> online RegionServers. Its regions are therefore assigned to the default 
> RSGroup, or to any available RegionServer if the default group also has no 
> online servers.
> The regions remain available on these fallback servers. However, *during 
> every balance run, RSGroupBasedLoadBalancer validates their current locations 
> only against the table’s original RSGroup.* *Because that group still has no 
> online RegionServers, all fallback-hosted regions are classified as 
> misplaced. The balancer then creates region move plans with no explicit 
> destination, causing the regions to be randomly reassigned among the fallback 
> candidates*. The same process repeats on every balance run, resulting in 
> continuous and unnecessary region movement even when the fallback servers are 
> already balanced.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to