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

Xiaolin Ha commented on HBASE-25635:
------------------------------------

Thanks for your advice, [~vjasani].

Yes, my patch is similar to #2293. 

I tested TestStochasticLoadBalancerHeterogeneousCost and also found the 
failures, I'll try to resolve them. Thanks.

> 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
>
> {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