From cec35b6e801cc917868cc3806c976473bd5f8afe Mon Sep 17 00:00:00 2001 From: d-c-manning <67607031+d-c-manning@users.noreply.github.com> Date: Sat, 21 May 2022 09:17:04 -0700 Subject: [PATCH] HBASE-27054 TestStochasticLoadBalancerRegionReplicaLargeCluster.testRegionReplicasOnLargeCluster is flaky (#4454) Signed-off-by: Andrew Purtell --- ...stStochasticLoadBalancerRegionReplicaLargeCluster.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hbase-balancer/src/test/java/org/apache/hadoop/hbase/master/balancer/TestStochasticLoadBalancerRegionReplicaLargeCluster.java b/hbase-balancer/src/test/java/org/apache/hadoop/hbase/master/balancer/TestStochasticLoadBalancerRegionReplicaLargeCluster.java index f5c58cb62b20..af010033ae55 100644 --- a/hbase-balancer/src/test/java/org/apache/hadoop/hbase/master/balancer/TestStochasticLoadBalancerRegionReplicaLargeCluster.java +++ b/hbase-balancer/src/test/java/org/apache/hadoop/hbase/master/balancer/TestStochasticLoadBalancerRegionReplicaLargeCluster.java @@ -26,7 +26,7 @@ @Category({ MasterTests.class, LargeTests.class }) public class TestStochasticLoadBalancerRegionReplicaLargeCluster - extends StochasticBalancerTestBase2 { + extends StochasticBalancerTestBase { @ClassRule public static final HBaseClassTestRule CLASS_RULE = @@ -34,6 +34,12 @@ public class TestStochasticLoadBalancerRegionReplicaLargeCluster @Test public void testRegionReplicasOnLargeCluster() { + // With default values for moveCost and tableSkewCost, the balancer makes much slower progress. + // Since we're only looking for balance in region counts and no colocated replicas, we can + // ignore these two cost functions to allow us to make any move that helps other functions. + conf.setFloat("hbase.master.balancer.stochastic.moveCost", 0f); + conf.setFloat("hbase.master.balancer.stochastic.tableSkewCost", 0f); + loadBalancer.onConfigurationChange(conf); int numNodes = 1000; int numRegions = 20 * numNodes; // 20 * replication regions per RS int numRegionsPerServer = 19; // all servers except one