fix: route move_context_files renames through the fault-injection choke point - #592
Merged
Conversation
…ke point move_context_files used a bare fs::rename, so the crate's highest-risk multi-step FS operation (a ten-file family move) was the one thing fail_persistence_ops_after could never reach, even though storage.rs's own doc claimed every persistence operation was covered. Route it through rename_persisted_file like every other rename, correct the doc to say what is and isn't covered (fsync and reads are deliberately outside the net), and update the one existing test whose comment documented the bypass as a workaround. Refs #586
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthrough各ファイルの rename を Changesリネーム永続化処理
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
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.
Summary
move_context_filesused a barefs::rename, so the crate's highest-risk multi-step FS operation (a ten-file family move) was the one thingfail_persistence_ops_aftercould never reach — even thoughstorage.rs's own doc claimed every persistence operation was covered.rename_persisted_filechoke point like every other rename in the crate, and correct the doc to say precisely what is and isn't covered (fsyncand plain reads are deliberately outside the net — durability and read paths have no write-ordering story to get wrong).Part of #586 (persistence-layer diagnosability audit from #533). Refs #586.
Test plan
cargo fmtcargo clippy --all-targets(clean)cargo test(full suite green)cargo mutants --in-diff): 1 mutant, 1 caught, 0 missedhttps://claude.ai/code/session_013NPb5cDU8ojZAKGJaq8rYy
Summary by CodeRabbit
バグ修正
テスト