From d0498d979cdb9aa17065c27572f35a80fc7d59c9 Mon Sep 17 00:00:00 2001 From: tedyu Date: Tue, 7 Feb 2017 12:24:20 -0800 Subject: [PATCH] HBASE-17565 StochasticLoadBalancer may incorrectly skip balancing due to skewed multiplier sum - addendum resets min cost --- .../hbase/master/balancer/TestStochasticLoadBalancer.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/balancer/TestStochasticLoadBalancer.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/balancer/TestStochasticLoadBalancer.java index e18334ba73d..614d2fb6c8d 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/balancer/TestStochasticLoadBalancer.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/balancer/TestStochasticLoadBalancer.java @@ -96,6 +96,7 @@ public class TestStochasticLoadBalancer extends BalancerTestBase { @Test public void testNeedBalance() { + float minCost = conf.getFloat("hbase.master.balancer.stochastic.minCostNeedBalance", 0.05f); conf.setFloat("hbase.master.balancer.stochastic.minCostNeedBalance", 1.0f); loadBalancer.setConf(conf); for (int[] mockCluster : clusterStateMocks) { @@ -104,6 +105,7 @@ public class TestStochasticLoadBalancer extends BalancerTestBase { assertNull(plans); } // reset config + conf.setFloat("hbase.master.balancer.stochastic.minCostNeedBalance", minCost); loadBalancer.setConf(conf); }