Skip to content

Commit

Permalink
roachtest: re-enable load-splitting for some kv tests
Browse files Browse the repository at this point in the history
In cockroachdb#58670 we overloaded `splits: -1` to also disable load-based
splitting. This rather dramatically changes the req/sec these tests
can achieve, producing worrying drops in our historical performance
monitoring.

This adds a new option for disabling load splitting so that we can
keep the behaviour of the previous tests.

Release note: None
  • Loading branch information
stevendanna committed Jul 1, 2021
1 parent 2f41ff5 commit 353fa43
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions pkg/cmd/roachtest/kv.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,17 @@ func registerKV(r *testRegistry) {
// If true, the reads are limited reads over the full span of the table.
// Currently this also enables SFU writes on the workload since this is
// geared towards testing optimistic locking and latching.
spanReads bool
batchSize int
blockSize int
splits int // 0 implies default, negative implies 0
encryption bool
sequential bool
concMultiplier int
duration time.Duration
tags []string
spanReads bool
batchSize int
blockSize int
splits int // 0 implies default, negative implies 0
// If true, load-based splitting will be disabled.
disableLoadSplits bool
encryption bool
sequential bool
concMultiplier int
duration time.Duration
tags []string
}
computeNumSplits := func(opts kvOptions) int {
// TODO(ajwerner): set this default to a more sane value or remove it and
Expand All @@ -70,9 +72,7 @@ func registerKV(r *testRegistry) {
c.Put(ctx, workload, "./workload", c.Node(nodes+1))
c.Start(ctx, c.Range(1, nodes), startArgs(fmt.Sprintf("--encrypt=%t", opts.encryption)))

if opts.splits < 0 {
// In addition to telling the workload to not split, disable load-based
// splitting.
if opts.disableLoadSplits {
db := c.Conn(ctx, 1)
defer db.Close()
if _, err := db.ExecContext(ctx, "SET CLUSTER SETTING kv.range_split.by_load_enabled = 'false'"); err != nil {
Expand Down Expand Up @@ -181,8 +181,8 @@ func registerKV(r *testRegistry) {
{nodes: 3, cpus: 32, readPercent: 95, sequential: true},

// Configs with reads, that are of limited spans, along with SFU writes.
{nodes: 1, cpus: 8, readPercent: 95, spanReads: true, splits: -1 /* no splits */, sequential: true},
{nodes: 1, cpus: 32, readPercent: 95, spanReads: true, splits: -1 /* no splits */, sequential: true},
{nodes: 1, cpus: 8, readPercent: 95, spanReads: true, splits: -1 /* no splits */, disableLoadSplits: true, sequential: true},
{nodes: 1, cpus: 32, readPercent: 95, spanReads: true, splits: -1 /* no splits */, disableLoadSplits: true, sequential: true},

// Weekly larger scale configurations.
{nodes: 32, cpus: 8, readPercent: 0, tags: []string{"weekly"}, duration: time.Hour},
Expand Down Expand Up @@ -219,6 +219,9 @@ func registerKV(r *testRegistry) {
if opts.concMultiplier != 0 { // support legacy test name which didn't include this multiplier
nameParts = append(nameParts, fmt.Sprintf("conc=%d", opts.concMultiplier))
}
if opts.disableLoadSplits {
nameParts = append(nameParts, "no-load-splitting")
}

minVersion := "v2.0.0"
if opts.encryption {
Expand Down

0 comments on commit 353fa43

Please sign in to comment.