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

Region load balancing by table does not handle the case where a table's region count is lower than the number of the RS in the cluster

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.92.0
    • Fix Version/s: 0.94.3, 0.95.0
    • Component/s: master
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      When the table's region count is less than the count of region servers, the region balance algorithm will not move the region. For example, the cluster has 100 RS, the table has 50 regions sitting on one RS, they will not be moved to any of the other 99 RS.

      This is because the algorithm did not calculate the under-loaded RS correctly. This is how the algorithm works with the above example:

      avg-regions-per-RS=0.5
      min-RS-per-RS=0
      max-RS-per-RS=1

      when they calculate the under loaded RS, the code is as below. Since regionCount=0, which is always >=min, so it will always skip, therefore, no underloaded RS are found.

      Map<ServerName, Integer> underloadedServers = new HashMap<ServerName, Integer>();
      for (Map.Entry<ServerAndLoad, List<HRegionInfo>> server:
      serversByLoad.entrySet()) {
      int regionCount = server.getKey().getLoad();
      if (regionCount >= min)

      { break; }

      underloadedServers.put(server.getKey().getServerName(), min - regionCount);
      }

      Later the function returns since underloaded RS size is 0

      if (serverUnerloaded ==0) return regionsToReturn;

        Attachments

        1. 7060-94.txt
          2 kB
          Ted Yu
        2. 7060-94-v2.txt
          2 kB
          Ted Yu
        3. 7060-test-tentative-94.txt
          0.8 kB
          Ted Yu
        4. 7060-trunk.txt
          1 kB
          Ted Yu
        5. HBASE-7060.patch
          1 kB
          Tianying Chang

          Activity

            People

            • Assignee:
              zhihyu@ebaysf.com Ted Yu
              Reporter:
              tychang Tianying Chang
            • Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: