Skip to content

Commit 2a25935

Browse files
committed
ci: clarify compaction correctness baseline vs expanded lanes
1 parent c22b01c commit 2a25935

File tree

3 files changed

+36
-7
lines changed

3 files changed

+36
-7
lines changed

.github/workflows/rust.yml

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ jobs:
4848
- name: Run cargo test
4949
run: cargo test --verbose --workspace
5050

51-
compaction-correctness:
52-
name: compaction correctness
51+
compaction-correctness-deterministic:
52+
name: compaction correctness (required deterministic baseline)
5353
runs-on: ubuntu-latest
5454
needs: build
5555
steps:
@@ -58,11 +58,33 @@ jobs:
5858
- name: Rust Cache
5959
uses: Swatinem/rust-cache@v2
6060
with:
61-
key: ${{ runner.os }}-${{ runner.arch }}-cargo-${{ hashFiles('**/Cargo.toml') }}-compaction-correctness
61+
key: ${{ runner.os }}-${{ runner.arch }}-cargo-${{ hashFiles('**/Cargo.toml') }}-compaction-correctness-deterministic
6262
cache-on-failure: false
6363

64-
- name: Run compaction correctness gate (default seeds)
65-
run: cargo test --package tonbo --lib compaction_correctness_ -- --nocapture
64+
- name: Run deterministic compaction correctness baseline (exclude randomized model)
65+
run: cargo test --package tonbo --lib compaction_correctness_ -- --skip compaction_correctness_model_randomized --nocapture
66+
67+
compaction-correctness-randomized-expanded:
68+
name: compaction correctness (optional expanded randomized sst+reopen)
69+
runs-on: ubuntu-latest
70+
needs: build
71+
continue-on-error: true
72+
env:
73+
TONBO_COMPACTION_MODEL_SST: "1"
74+
TONBO_COMPACTION_REOPEN: "1"
75+
TONBO_COMPACTION_EAGER_FLUSH: "1"
76+
TONBO_COMPACTION_SEED: "1,13,57,101,1009"
77+
steps:
78+
- uses: actions/checkout@v4
79+
80+
- name: Rust Cache
81+
uses: Swatinem/rust-cache@v2
82+
with:
83+
key: ${{ runner.os }}-${{ runner.arch }}-cargo-${{ hashFiles('**/Cargo.toml') }}-compaction-correctness-randomized-expanded
84+
cache-on-failure: false
85+
86+
- name: Run expanded randomized model (sst+reopen enabled)
87+
run: cargo test --package tonbo --lib compaction_correctness_model_randomized -- --nocapture
6688

6789
coverage:
6890
name: coverage (llvm-cov)

docs/rfcs/0012-compaction-correctness-gate.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Compaction rewrites physical layout and can silently break logical correctness.
2323
## Non-Goals
2424

2525
- Performance benchmarking or tuning.
26-
- CI gating or long-running fuzzing (added later once validated).
26+
- Long-running fuzzing as a required CI blocker.
2727
- Full coverage of crash recovery or manifest/GC interactions (follow-on work).
2828
- Guaranteeing correctness for future range tombstones or remote compaction (follow-on work).
2929

@@ -114,6 +114,11 @@ The gate must emit enough context to replay failures:
114114

115115
Initial coverage targets **minor compaction** and the current read path across mutable + immutable + SST layers. Major compaction, manifest/GC, and remote execution are validated in Phase 1+ after the minimal gate is stable.
116116

117+
### CI Execution Lanes
118+
119+
- **Required deterministic baseline:** run `compaction_correctness_` while skipping `compaction_correctness_model_randomized`. This keeps the required gate reproducible and focused on deterministic scenario coverage.
120+
- **Optional expanded randomized lane:** run `compaction_correctness_model_randomized` with `TONBO_COMPACTION_MODEL_SST=1`, `TONBO_COMPACTION_REOPEN=1`, and `TONBO_COMPACTION_EAGER_FLUSH=1` (with explicit seed list) to intentionally exercise SST/compaction/reopen model behavior.
121+
117122
## References
118123

119124
- [Model-based testing](https://en.wikipedia.org/wiki/Model-based_testing)
@@ -125,6 +130,6 @@ Initial coverage targets **minor compaction** and the current read path across m
125130

126131
- Add tombstone pruning safety tests and MVCC watermark checks.
127132
- Extend coverage to major compaction, manifest updates, and GC integration.
128-
- Enable CI gating and nightly fuzzing once test stability is confirmed.
133+
- Promote expanded randomized coverage from optional to required once SST/page-index stability is complete.
129134
- Add crash/reopen validation as part of the gate.
130135
- Add range tombstone semantics when supported.

src/db/tests/core/compaction_correctness.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -643,6 +643,8 @@ struct ModelRunner {
643643

644644
impl ModelRunner {
645645
async fn new(seed: u64, name: &str) -> Result<Self, Box<dyn std::error::Error>> {
646+
// Baseline runs leave SST/reopen off for deterministic behavior. Expanded CI coverage
647+
// opts into randomized SST/compaction/reopen paths via these env toggles.
646648
let allow_reopen = env::var("TONBO_COMPACTION_REOPEN").is_ok();
647649
let allow_sst = env::var("TONBO_COMPACTION_MODEL_SST").is_ok();
648650
let eager_flush = allow_sst

0 commit comments

Comments
 (0)