HBASE-26297 Balancer run is improperly triggered by accuracy error of double comparison (#3698)
Signed-off-by: Duo Zhang <zhangduo@apache.org>
This commit is contained in:
parent
49ae675275
commit
73f42b27bf
|
@ -295,11 +295,11 @@ public class StochasticLoadBalancer extends BaseLoadBalancer {
|
|||
|
||||
private boolean areSomeRegionReplicasColocated(BalancerClusterState c) {
|
||||
regionReplicaHostCostFunction.prepare(c);
|
||||
if (regionReplicaHostCostFunction.cost() > 0) {
|
||||
if (Math.abs(regionReplicaHostCostFunction.cost()) > CostFunction.COST_EPSILON) {
|
||||
return true;
|
||||
}
|
||||
regionReplicaRackCostFunction.prepare(c);
|
||||
if (regionReplicaRackCostFunction.cost() > 0) {
|
||||
if (Math.abs(regionReplicaRackCostFunction.cost()) > CostFunction.COST_EPSILON) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue