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

CandidateGenerator may miss some region balance actions

VotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0
    • Fix Version/s: 3.0.0-alpha-1, 2.5.0, 2.3.5, 2.4.3
    • Component/s: Balancer
    • Labels:
      None
    • Hadoop Flags:
      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

            • Assignee:
              Xiaolin Ha Xiaolin Ha
              Reporter:
              Xiaolin Ha Xiaolin Ha

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment