From 73fcf3e688281cbf50a0737ffe3a1b6e16359d2f Mon Sep 17 00:00:00 2001 From: Alex Robinson Date: Mon, 20 Aug 2018 04:12:40 -0500 Subject: [PATCH] roachtest: Add test for load-based replica rebalancing It's identical to the test for load-based lease rebalancing, just with more than 3 nodes such that replicas must be rebalanced in addition to leases in order for load to be properly spread across all nodes. Release note: None --- pkg/cmd/roachtest/rebalance_load.go | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/pkg/cmd/roachtest/rebalance_load.go b/pkg/cmd/roachtest/rebalance_load.go index 698f2f43a83f..716dbe0145bc 100644 --- a/pkg/cmd/roachtest/rebalance_load.go +++ b/pkg/cmd/roachtest/rebalance_load.go @@ -107,20 +107,30 @@ func registerRebalanceLoad(r *registry) { } } - minutes := 2 * time.Minute - numNodes := 4 // the last node is just used to generate load concurrency := 128 r.Add(testSpec{ Name: `rebalance-leases-by-load`, - Nodes: nodes(numNodes), - Stable: false, // TODO(a-robinson): Promote to stable + Nodes: nodes(4), // the last node is just used to generate load + Stable: false, // TODO(a-robinson): Promote to stable Run: func(ctx context.Context, t *test, c *cluster) { if local { concurrency = 32 fmt.Printf("lowering concurrency to %d in local testing\n", concurrency) } - rebalanceLoadRun(ctx, t, c, minutes, concurrency) + rebalanceLoadRun(ctx, t, c, 2*time.Minute, concurrency) + }, + }) + r.Add(testSpec{ + Name: `rebalance-replicas-by-load`, + Nodes: nodes(7), // the last node is just used to generate load + Stable: false, // TODO(a-robinson): Promote to stable + Run: func(ctx context.Context, t *test, c *cluster) { + if local { + concurrency = 32 + fmt.Printf("lowering concurrency to %d in local testing\n", concurrency) + } + rebalanceLoadRun(ctx, t, c, 5*time.Minute, concurrency) }, }) }