Commit 9314462
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).
asleep=true targets ~9,400 replicas/vcpu (40% over the production
telemetry cluster's ~6,700 replicas/vcpu non-quiescent density) to
stress-test the primary quiescence path beyond current production
density; asleep=false targets ~6,250 replicas/vcpu to match the
telemetry cluster's observed non-quiescent density. 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():
- asleep=true: targetSplits=600k, batchSize=10k (full); the optional
devSizer / metamorphicSizer interfaces (added in this commit) let
the dev and metamorphic variants shrink to 4k and 60k respectively.
- asleep=false: targetSplits=400k, batchSize=5k (full); 40k metamorphic;
shares the 4k dev with asleep=true.
- 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-2M 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. Both
flavors share these thresholds; the asleep=false gates may be
tightened in a follow-up now that the flavor lands at production
density.
- SkipPostValidations=PostValidationReplicaDivergence: at 1.2M-1.8M
ranges the post-test consistency check can't scan a meaningful
fraction within the framework's 20m budget (observed: 0 ranges in
20m). The framework tolerates the timeout but logs it as a
post-assertion failure; skipping explicitly keeps the artifact clean.
addDev now also zeros v.recoveryImpact, v.timeout, and v.tokenReturnTime,
all 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), a 5h test timeout (would hide
hangs behind a long wait), and a 1h token-return wait (wildly
overshoots what's meaningful on a 5-node local cluster).
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 d74b408 commit 9314462
3 files changed
Lines changed: 1136 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 | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
126 | 131 | | |
127 | 132 | | |
128 | 133 | | |
| |||
395 | 400 | | |
396 | 401 | | |
397 | 402 | | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
398 | 406 | | |
399 | 407 | | |
400 | 408 | | |
| |||
416 | 424 | | |
417 | 425 | | |
418 | 426 | | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
419 | 434 | | |
420 | 435 | | |
421 | 436 | | |
| |||
571 | 586 | | |
572 | 587 | | |
573 | 588 | | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
574 | 596 | | |
575 | 597 | | |
576 | 598 | | |
| |||
581 | 603 | | |
582 | 604 | | |
583 | 605 | | |
| 606 | + | |
584 | 607 | | |
585 | 608 | | |
586 | 609 | | |
| |||
600 | 623 | | |
601 | 624 | | |
602 | 625 | | |
| 626 | + | |
603 | 627 | | |
604 | 628 | | |
605 | 629 | | |
| |||
673 | 697 | | |
674 | 698 | | |
675 | 699 | | |
676 | | - | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
677 | 706 | | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
678 | 716 | | |
679 | 717 | | |
680 | 718 | | |
| |||
696 | 734 | | |
697 | 735 | | |
698 | 736 | | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
699 | 743 | | |
700 | 744 | | |
701 | 745 | | |
| |||
747 | 791 | | |
748 | 792 | | |
749 | 793 | | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
750 | 806 | | |
751 | 807 | | |
752 | 808 | | |
| |||
0 commit comments