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

CandidateGenerator may miss some region balance actions

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.0.0
    • 3.0.0-alpha-1, 2.5.0, 2.3.5, 2.4.3
    • Balancer
    • None
    • Reviewed

    Description

      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.

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

       

      Attachments

        1. 1614940188041-image.png
          605 kB
          Xiaolin Ha

        Issue Links

          Activity

            People

              Xiaolin Ha Xiaolin Ha
              Xiaolin Ha Xiaolin Ha
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: