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

Balancer run is improperly triggered by accuracy error of double comparison

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.5.0, 3.0.0-alpha-2, 2.3.7, 2.4.7
    • Balancer
    • None
    •  
    • Reviewed

    Description

      protected synchronized boolean areSomeRegionReplicasColocated(Cluster c) {
        regionReplicaHostCostFunction.init(c);
        if (regionReplicaHostCostFunction.cost() > 0) {
          return true;
        }
        regionReplicaRackCostFunction.init(c);
        if (regionReplicaRackCostFunction.cost() > 0) {
          return true;
        }
      
      

      The values are in double data type. Balancer could get stuck in constant runs and unnecessary moves.

      2021-09-24 12:02:41,943 INFO org.apache.hadoop.hbase.master.balancer.StochasticLoadBalancer: Running balancer because at least one server hosts replicas of the same region.
      2021-09-24 12:01:42,878 INFO org.apache.hadoop.hbase.master.balancer.StochasticLoadBalancer: Finished computing new moving plan. Computation took 2400001 ms to try 3048341 different iterations.  Found a solution that moves 81 regions; Going from a computed imbalance of 1.7429830473781883E-4 to a new imbalance of 1.6169961756947032E-4. 
      

       we should use COST_EPSILON instead of 0 for double comparison.

       

       

      Attachments

        Issue Links

          Activity

            People

              claraxiong Clara Xiong
              claraxiong Clara Xiong
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: