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

region balance algorithm should do "contiue" instead of "break" when calculating the underloaded server

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.92.3
    • Component/s: None
    • Labels:
      None

      Description

      I found this issue when investigating HBASE-7060. Basically, I think the intention of this code below is to find all the underloaded server. By using break, it will exit earlier, depending on where the non-overloaded server show up in the list. "break" should be changed to "continue".

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

        Attachments

          Activity

            People

            • Assignee:
              tychang Tianying Chang
              Reporter:
              tychang Tianying Chang
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: