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

StochasticLoadBalancer RegionLoads aren’t being used in RegionLoad cost functions

    XMLWordPrintableJSON

    Details

    • Hadoop Flags:
      Reviewed

      Description

      In StochasticLoadBalancer.updateRegionLoad() the region loads are being put into the map with Bytes.toString(regionName).

      First, this is a problem because Bytes.toString() assumes that the byte array is a UTF8 encoded String but there is no guarantee that regionName bytes are legal UTF8.

      Secondly, in BaseLoadBalancer.registerRegion, we are reading the region loads out of the load map not using Bytes.toString() but using region.getRegionNameAsString() and region.getEncodedName(). So the load balancer will not see or use any of the cluster's RegionLoad history.

      There are 2 primary ways to solve this issue, assuming we want to stay with String keys for the load map (seems reasonable to aid debugging). We can either fix updateRegionLoad to store the regionName as a string properly or we can update both the reader & writer to use a new common valid String representation.

      Will post a patch assuming we want to pursue the original intention, i.e. store regionNameAsAString for the loadmap key, but I'm open to fixing this a different way.

        Attachments

        1. HBASE-21439-master.patch
          7 kB
          Ben Lau
        2. HBASE-21439-branch-1.patch
          5 kB
          Andrew Kyle Purtell
        3. HBASE-21439-addendum-master.patch
          1 kB
          Ben Lau
        4. HBASE-21439-branch-1.patch
          6 kB
          Andrew Kyle Purtell

          Activity

            People

            • Assignee:
              benlau Ben Lau
              Reporter:
              benlau Ben Lau
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: