Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-24931

Candidate Generator helper getAction method ignoring 0th index region

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Balancer
    • Labels:
      None

      Description

      Balance Candidate generators such as `LocalityBasedCandidateGenerator`, `RegionReplicaCandidateGenerator`,  `RegionReplicaRackCandidateGenerator`, etc uses helper method `getAction` to generate action is ignoring 0th index of `fromRegion` and `toRegion`. 

      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;
        }
      }
      

      Is this unintentional or there is some particular reason? 

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                rda3mon Mallikarjun
                Reporter:
                rda3mon Mallikarjun
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: