[
https://issues.apache.org/jira/browse/HBASE-24931?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17182708#comment-17182708
]
Mallikarjun commented on HBASE-24931:
-------------------------------------
To give more context: I noticed this bug while writing a custom Candidate
generator for reassigning those regions which had one of their favorednodes
dead. Cost Multiplier was on the higher side, and hence it was always balancing
while 1 region was never reassigned.
> Candidate Generator helper getAction method ignoring 0th index region
> ---------------------------------------------------------------------
>
> Key: HBASE-24931
> URL: https://issues.apache.org/jira/browse/HBASE-24931
> Project: HBase
> Issue Type: Bug
> Components: Balancer
> Reporter: Mallikarjun
> Assignee: Mallikarjun
> Priority: Minor
>
> Balance Candidate generators such as `LocalityBasedCandidateGenerator`,
> `RegionReplicaCandidateGenerator`, `RegionReplicaRackCandidateGenerator`,
> etc uses helper method `getAction` to generate action is ignoring 0th index
> of `fromRegion` and `toRegion`.
> {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}
> Is this unintentional or there is some particular reason?
--
This message was sent by Atlassian Jira
(v8.3.4#803005)