RustFS DST is the official Deterministic Simulation Testing (DST) framework, runtime trait abstraction layer, virtual fault simulator, and multi-seed correctness verifier for RustFS.
Inspired by FoundationDB's Flow simulator, Tokio turmoil, madsim, and Antithesis, RustFS DST uses runtime traits to run a storage model against seeded faults. The scenarios execute SimECStore or the Turmoil quorum model. The upstream adoption plan describes how to apply these runtime traits to RustFS itself.
┌──────────────────────────────────────────────┐
│ RustFS Storage Engine Subsystems │
│ (ECStore · Distributed Lock · Heal · GC) │
└──────────────────────┬───────────────────────┘
│
Unified Determinism Traits
(`rustfs-dst-runtime`)
┌────────────────────┬───────────────┴──────────────┬────────────────────┐
▼ ▼ ▼ ▼
trait Clock trait RngSource trait Network trait DiskIo
├─ RealClock ├─ RealRng ├─ SimNetwork ├─ RealDiskIo
└─ SimClock └─ SimRng (ChaCha8 + fork) │ (Swizzle-Clog, └─ SimDiskIo
(skew, drift, │ asymmetric cuts, (volatile vs
virtual time) │ reply drops) durable fsync,
└─ turmoil::net power loss,
(virtual TCP) bitrot, ENOSPC)
| Crate | Purpose |
|---|---|
rustfs-dst-runtime |
Unified traits (Clock, RngSource, Network, DiskIo, RuntimeEnv) with production, in-memory deterministic simulator, Tokio turmoil virtual TCP adapter, and madsim compatibility layer. |
rustfs-dst-faults |
Two-stage deterministic Buggify injector, CodeProbe coverage tracker with Antithesis-compatible JSONL assertion emission, RustFS commit CrashPoint registry, and SwizzleClogScheduler. |
rustfs-dst-sim |
Simulated RustFS distributed erasure-coded storage engine (SimECStore) with GF(2^8) Cauchy Reed-Solomon, xl.meta atomic two-phase commit, quorum locking, online healing, real turmoil TCP cluster tests, and a 6-invariant ConsistencyOracle. |
rustfs-dst-cli |
Joshua-style parallel multi-seed runner (rustfs-dst run), single-seed bit-exact reproducer (rustfs-dst repro), and determinism prover (rustfs-dst verify-determinism). |
- Sequential S3 Read-After-Write Consistency: GET responses must match a possible current version after acknowledged or indeterminate writes and deletes. LIST is checked against acknowledged live keys and their version metadata before repair.
- Bit-Exact Data Integrity: Every readable object matches the exact SHA-256 of an acknowledged or indeterminate write for that version. Silent bitrot up to the parity limit is detected and reconstructed transparently.
- Crash Atomicity (Old-or-New-Never-Mixed): Abrupt power loss (
SimDiskIo::crash_and_reboot) at any RustFSxl.metacommit window drops un-fsynced page-cache state without corrupting previously committed versions. - Quorum Safety: Writes fail closed on minority partitions and roll back partial drive writes cleanly; reply drops after remote apply are modeled as indeterminate outcomes.
- Distributed Lock Mutual Exclusion & Monotonic Fencing: Monotonic-clock quorum leases remain immune to wall-clock skew jumps and issue strictly increasing fencing epochs.
- Heal Convergence & Zero Orphan Leaks: Post-heal, every drive in
4x4(16 drives, EC:4),3x2(6 drives, EC:3), and4x2(8 drives, EC:4) converges to the identical generation with zero leaked.rustfs.sys/tmp/artifacts.
# Run the full unit and integration test suite
cargo test --workspace
# Compare two passing reports for every scenario
cargo run --release -p rustfs-dst-cli -- verify-determinism --topology 4x4 --seed 2026
# Run a 100-seed parallel DST campaign on 4x4 and 3x2 topologies
cargo run --release -p rustfs-dst-cli -- run --scenario all --topology 4x4 --seeds 100
cargo run --release -p rustfs-dst-cli -- run --scenario all --topology 3x2 --seeds 100
# Replay a single failing seed deterministically
cargo run --release -p rustfs-dst-cli -- repro --scenario swizzle-clog-chaos --topology 4x4 --seed 42| Topology | Nodes × Drives | Total Drives | Parity (m) |
Data (k) |
Read Quorum (R) |
Write Quorum (W) |
|---|---|---|---|---|---|---|
4x4 |
4 × 4 | 16 | 4 | 12 | 12 | 12 |
3x2 |
3 × 2 | 6 | 3 | 3 | 3 | 4 |
4x2 |
4 × 2 | 8 | 4 | 4 | 4 | 5 |
- Complete 33-Scenario Coverage Matrix (7 Core + 19 Enterprise + 7 Scanner Chaos)
- Architecture & Upstream Trait Adoption Blueprint (
rustfs/rustfs) - Simulation Backends: In-Process, Turmoil, Madsim & Antithesis
- Jepsen Distributed Verification Companion (
rustfs/Jepsen)
Licensed under the Apache License, Version 2.0.