Skip to content

Commit

Permalink
roachtest: Add test for load-based replica rebalancing
Browse files Browse the repository at this point in the history
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
  • Loading branch information
a-robinson committed Sep 6, 2018
1 parent b8da9c9 commit 73fcf3e
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions pkg/cmd/roachtest/rebalance_load.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
},
})
}
Expand Down

0 comments on commit 73fcf3e

Please sign in to comment.