Skip to content

Commit

Permalink
roachtest: use qps splitting for splits/load tests
Browse files Browse the repository at this point in the history
This commit updates the clusters used in `splits/load` roachtests to use
QPS load based splitting, rather than CPU, which was enabled by default
in cockroachdb#97424.

These tests were failing as they assumed QPS load based splitting when
calculating the number of final ranges to assert against.

These tests should be run against all load based split objectives, this
is tracked in cockroachdb#97540.

Resolves: cockroachdb#97494
Resolves: cockroachdb#97455
Informs:  cockroachdb#97540

Release note: None
  • Loading branch information
kvoli committed Feb 23, 2023
1 parent 1c49593 commit 0df5ea5
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions pkg/cmd/roachtest/tests/split.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,13 @@ func runLoadSplits(ctx context.Context, t test.Test, c cluster.Cluster, params s
return err
}

// TODO(kvoli): Add load split tests which use CPU, similar to the current
// QPS ones. Tracked by #97540.
t.Status("setting split objective to QPS")
if err := setLoadBasedRebalancingObjective(ctx, db, "qps"); err != nil {
return err
}

t.Status("increasing range_max_bytes")
minBytes := 16 << 20 // 16 MB
setRangeMaxBytes := func(maxBytes int) {
Expand Down Expand Up @@ -439,3 +446,12 @@ func disableLoadBasedSplitting(ctx context.Context, db *gosql.DB) error {
}
return nil
}

func setLoadBasedRebalancingObjective(ctx context.Context, db *gosql.DB, obj string) error {
_, err := db.ExecContext(
ctx,
fmt.Sprintf(`SET CLUSTER SETTING kv.allocator.load_based_rebalancing.objective = '%s'`, obj),
)
return err

}

0 comments on commit 0df5ea5

Please sign in to comment.