Skip to content

Commit

Permalink
Merge #82770
Browse files Browse the repository at this point in the history
82770: roachtest: add a multi-store lease rebalancing roachtest r=lidorcarmel a=lidorcarmel

We rencetly added a multi-store roachtest for rebalancing, and this
one is for moving leases.

Fixes #79841

Release note: None

Co-authored-by: Lidor Carmel <[email protected]>
  • Loading branch information
craig[bot] and lidorcarmel committed Jul 11, 2022
2 parents c16f589 + 7ac26c0 commit 87e3efc
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions pkg/cmd/roachtest/tests/rebalance_load.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,36 @@ func registerRebalanceLoad(r registry.Registry) {
},
},
)
r.Add(
registry.TestSpec{
Name: `rebalance/by-load/leases/ssds=2`,
Owner: registry.OwnerKV,
Cluster: r.MakeClusterSpec(4, spec.SSD(2)), // the last node is just used to generate load
Run: func(ctx context.Context, t test.Test, c cluster.Cluster) {
if c.IsLocal() {
t.Fatal("cannot run multi-store in local mode")
}

// Increase replication to 6 in order to allow lease shedding get the
// cluster perfectly balanced. Note that we have 6 stores here on 3
// nodes, and we disable replica moves. If we only have 3 replicas we
// may have hot stores that can only shed leases to other hot stores,
// and therefore we may never get to a balanced lease count.
db := c.Conn(ctx, t.L(), 1)
defer db.Close()
exec := func(stmt string) {
_, err := db.ExecContext(ctx, stmt)
require.NoError(t, err)
}
exec("ALTER RANGE default CONFIGURE ZONE USING num_replicas=6")
exec("ALTER DATABASE system CONFIGURE ZONE USING num_replicas=6")

rebalanceLoadRun(
ctx, t, c, "leases", 6*time.Minute, concurrency, false, /* mixedVersion */
)
},
},
)
r.Add(
registry.TestSpec{
Name: `rebalance/by-load/replicas`,
Expand Down

0 comments on commit 87e3efc

Please sign in to comment.