refactor: transaction.rs extraction — PR 1 (module split + FaultInjector) - #76
Merged
Conversation
🚦 Bench results: PR vs main✅ No regressions detected
Per-scenario detail (4 metrics × cells)document-store
mutation-log
ycsb-a
ycsb-b
|
This was referenced Jun 23, 2026
Merged
Xof
added a commit
that referenced
this pull request
Jun 23, 2026
…ion deferred (I141) (#80) The 2026-06-22 review's god-module SMELL was worked through four unit extractions (SlotPacker #77, FreemapRecycle #78, CommitProtocol #79, FaultInjector #76); the final StagingTxn extraction is deliberately deferred. The candidate-prepare/install staging vocabulary is shared across allocate_inner (staging.rs) and update_inner/delete_inner (mutate.rs), so a context-based extraction cannot be contained to staging.rs without dragging the delicate mutation paths through a mechanical wrapper change. Recorded as future work to be done incrementally if/when those paths are touched, not re-triggered from the SMELL alone.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First PR of the
transaction.rsgod-module extraction (the last carve-out from the 2026-06-22 fresh-eyes review — SMELL #4). A pure, behavior-preserving refactor: no logic, signature, or on-disk format change. The existing test suite is the oracle.What's here
docs/specs/,docs/plans/) — the 6-step extraction roadmap (file-split → FaultInjector → SlotPacker → FreemapRecycle → CommitProtocol → StagingTxn), each step green, each its own PR.224d66c):src/transaction.rs(5,580 lines) → asrc/transaction/directory module by concern (recovery,lifecycle,staging,freemap,packing,savepoints,named_roots,read,mutate,config,stats,tests).mod.rsis now a clean container (struct +Roots+Savepoint+moddecls). Pure code movement — verified by a normalized line-multiset diff showing zero dropped/altered code or comments (every delta is a visibility-prefix bump, themod testswrapper, or acargo fmtreflow). Each concern file gets a//!role header.d6618aa): the four#[cfg(test)]Cellfault flags consolidated off the productionTransactionManagerinto one#[cfg(test)] fault: fault::FaultInjector. Module-gated (#[cfg(test)] mod fault;) so it's fully absent in release. Pure access-path change (self.X→self.fault.X); every Cell operation byte-identical.Verification (the refactor discipline)
The full suite is green at the exact pre-refactor counts — no test behavior changed:
cargo test→ 578 passing, 0 failed (273 in thechisellib units that hold the transaction tests)cargo build --release→ clean (proves the cfg(test) fault field/module is absent in release)cargo clippy --workspace --all-targets -- -D warnings→ cleancargo fmt --check→ cleancd python && maturin develop && pytest→ 119 passingNot in this PR
Tasks 3–6 (the owned-unit / behavior-unit extractions) each ship as their own PR off updated
main, in low-risk → high-risk order.