Commit 95f0931
committed
roachtest: add splits perturbation test
Reframe "how many splits can the cluster sustain" as a perturbation
test that runs concurrently with a foreground KV workload and reports
impact in roachperf-comparable terms (throughput ratio, density in
replicas/vcpu/node). Supersedes the legacy kv/splits/*/quiesce=*/lease=*
binary tests dropped earlier in this PR.
Two flavors are registered together: asleep=true measures total replica
capacity (followers park via store liveness quiescence), asleep=false
measures active-replica capacity (every replica costs full per-tick
CPU, the relevant ceiling during outages where followers can't sleep).
Because awake replicas are far more expensive, the asleep=false
population is scaled down 5× at every cluster size. asleep=false also
disables store-liveness follower sleep via the
kv.raft.store_liveness.quiescence.enabled cluster setting; leader
leases keep leaseholders awake unconditionally so no additional knob
is needed.
Design (see the struct-level comment in splits.go for the long form):
- Partition the cluster's stores into disjoint groups of three on
distinct nodes; pin one database per group with voter_constraints
that one-to-one map each voter to a store. With this every split's
children inherit their parent's correct placement, so no SCATTER and
no rebalance churn during the split storm.
- Issue splits per group in parallel batches; descending keys per batch
to keep each split landing on the leftmost (stable, single-leader)
range rather than chaining new raft groups together.
- After batch 0 (and again at end-of-perturbation), do an explicit
deterministic round-robin lease rebalance via ALTER RANGE RELOCATE
LEASE. Plain SCATTER stalls at 1.5-3x spread under per-store
voter_constraints because the allocator's lease scorer picks the
same biased target on every re-scatter. Round-robin converges in one
pass; dispatch is parallelized within a group (concurrency 16) and
across groups (one task per group).
- Per-call ALTER RANGE failures are tolerated up to 10% (catches
systemic problems like a node down while shrugging off transient
range-merge races); a 100%-failure floor catches small-batch
pathologies that the percentage gate would skip. First error is
surfaced in the failure message and in a warn log when any failure
happens below the threshold.
Knobs in splits.setup():
- targetSplits=600k, batchSize=10k (asleep=true, full variant); the
optional devSizer / metamorphicSizer interfaces (added in this
commit) let the dev and metamorphic variants shrink to 4k and 60k
respectively. asleep=false uses 120k/2k/12k/800 at full/metamorphic/
dev (5× smaller across the board).
- v.splits=500 + v.scatter=true: enough kv ranges to avoid a
single-range hotspot for the foreground workload, scattered so
leases distribute evenly.
- v.timeout=5h: full 600k storm + end-of-perturbation rebalance runs
for over an hour; the default 3h budget is too tight. asleep=false
shares the budget since the rebalance phase dominates either way.
- v.tokenReturnTime=1h: real outstanding flow-control tokens drain
within seconds of workload cancel, but ValidateTokensReturned's SQL
query races against background flow-control activity (replicate
queue, lease queue, jobs) at 1.8M replicas and observed transient
non-zero diffs at the 10m default. A longer window gives the retry
loop a better chance to land on a clean snapshot.
- impact=10x, recoveryImpact=3x: during the split storm the cluster is
expected to absorb significant throughput loss; the meaningful
pass/fail signal is whether it returns to baseline afterwards.
asleep=false reuses these thresholds for now; they may be tightened
after the first calibration run if the lower replica population
produces materially less impact.
addDev now also zeros v.recoveryImpact and v.timeout, both of which
splits.setup() sets to non-zero values. Without these clears the dev
variant would inherit a 3x recovery throughput gate (too tight for
noisy local processes) and a 5h test timeout (would hide hangs behind
a long wait).
Test fixtures:
- waitForVoterPlacement polls per-range placement against the group's
expected store set and nudges non-conforming ranges into the
replicate queue via crdb_internal.kv_enqueue_replica (must run on
the leaseholder).
- waitForVoterPlacement budget defaults to 10 minutes and scales up to
v.timeout/3 (capped at 90 minutes) when the test sets a per-test
timeout. The 10-minute default suits the dev variant; the lift makes
the nightly variant tolerant of slow up-replication.
- reportDensity / reportBalance / summarize give per-node and per-store
range and lease distribution at every batch boundary, with
deterministic min/max tiebreaks so log diffs are stable across runs.
Epic: none
Release note: None1 parent 807aa90 commit 95f0931
3 files changed
Lines changed: 1113 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| 27 | + | |
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
| |||
34 | 36 | | |
35 | 37 | | |
36 | 38 | | |
| 39 | + | |
37 | 40 | | |
38 | 41 | | |
39 | 42 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
395 | 395 | | |
396 | 396 | | |
397 | 397 | | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
398 | 401 | | |
399 | 402 | | |
400 | 403 | | |
| |||
416 | 419 | | |
417 | 420 | | |
418 | 421 | | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
419 | 429 | | |
420 | 430 | | |
421 | 431 | | |
| |||
571 | 581 | | |
572 | 582 | | |
573 | 583 | | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
574 | 591 | | |
575 | 592 | | |
576 | 593 | | |
| |||
670 | 687 | | |
671 | 688 | | |
672 | 689 | | |
673 | | - | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
674 | 696 | | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
675 | 703 | | |
676 | 704 | | |
677 | 705 | | |
| |||
693 | 721 | | |
694 | 722 | | |
695 | 723 | | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
696 | 730 | | |
697 | 731 | | |
698 | 732 | | |
| |||
744 | 778 | | |
745 | 779 | | |
746 | 780 | | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
747 | 793 | | |
748 | 794 | | |
749 | 795 | | |
| |||
0 commit comments