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
2b26dfbaf4
commit
cbebf85b3c
|
@ -276,11 +276,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