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

Improve the selection of regions to balance

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 0.90.1
    • 0.90.2
    • None
    • None
    • Reviewed

    Description

      Currently LoadBalancer goes through the list of regions per RS and grabs the few first ones to balance. This is not bad, but that list is often sorted naturally since the a RS that boots will open the regions in a sequential and sorted order (since it comes from .META.) which means that we're balancing regions starting in an almost sorted fashion.

      We discovered that because one of our internal users created a new table starting with letter "p" which has now grown to 100 regions in the last few hours and they are all served by 1 region server. Looking at the master's log, the balancer has moved as many regions from that region server but they are all from the same table that starts with letter "a" (and the regions that were moved all come one after the other).

      The part of the code that should be modified is:

      for (HRegionInfo hri: regions) {
        // Don't rebalance meta regions.
        if (hri.isMetaRegion()) continue; 
        regionsToMove.add(new RegionPlan(hri, serverInfo, null));
        numTaken++;
        if (numTaken >= numToOffload) break;
      }
      

      Attachments

        1. HBASE-3586-by-region-age.patch
          2 kB
          Andrew Kyle Purtell
        2. HBASE-3586-by-region-age.patch
          2 kB
          Andrew Kyle Purtell
        3. hbase-3586-with-sort.txt
          2 kB
          Ted Yu
        4. hbase-3586-table-creation.txt
          1 kB
          Ted Yu
        5. 3586-randomize.txt
          9 kB
          Michael Stack
        6. 3586-randomize-v2.txt
          6 kB
          Michael Stack

        Issue Links

          Activity

            People

              yuzhihong@gmail.com Ted Yu
              jdcryans Jean-Daniel Cryans
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: