[ 
https://issues.apache.org/jira/browse/HBASE-25635?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Xiaolin Ha updated HBASE-25635:
-------------------------------
    Attachment: 1614940188041-image.png

> CandidateGenerator may miss some region balance actions
> -------------------------------------------------------
>
>                 Key: HBASE-25635
>                 URL: https://issues.apache.org/jira/browse/HBASE-25635
>             Project: HBase
>          Issue Type: Improvement
>    Affects Versions: 2.0.0
>            Reporter: Xiaolin Ha
>            Assignee: Xiaolin Ha
>            Priority: Major
>         Attachments: 1614940188041-image.png
>
>
> {color:#172b4d}In codes of CandidateGenerator#getAction(),valid region index 
> are greater or equal to zero. Currently only regions with greater than zero 
> indexes can get balance actions.{color}
> {code:java}
> protected BaseLoadBalancer.Cluster.Action getAction(int fromServer, int 
> fromRegion,
>     int toServer, int toRegion) {
>   if (fromServer < 0 || toServer < 0) {
>     return BaseLoadBalancer.Cluster.NullAction;
>   }
>   if (fromRegion > 0 && toRegion > 0) {
>     return new BaseLoadBalancer.Cluster.SwapRegionsAction(fromServer, 
> fromRegion,
>       toServer, toRegion);
>   } else if (fromRegion > 0) {
>     return new BaseLoadBalancer.Cluster.MoveRegionAction(fromRegion, 
> fromServer, toServer);
>   } else if (toRegion > 0) {
>     return new BaseLoadBalancer.Cluster.MoveRegionAction(toRegion, toServer, 
> fromServer);
>   } else {
>     return BaseLoadBalancer.Cluster.NullAction;
>   }
> }{code}
>  



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

Reply via email to