Skip to content

Write blocks to temp files and move atomically - #3232

Open
eclark0426 wants to merge 1 commit into
masterfrom
ellis/fs-atomic-writes
Open

eclark0426 wants to merge 1 commit into
masterfrom
ellis/fs-atomic-writes

Conversation

@eclark0426

Copy link
Copy Markdown
Contributor

No description provided.

@eclark0426 eclark0426 self-assigned this Aug 28, 2026
Copilot AI lite review requested due to automatic review settings August 28, 2026 16:16
@eclark0426
eclark0426 force-pushed the ellis/fs-atomic-writes branch from 98cf521 to b106bfb Compare August 28, 2026 16:16

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the filesystem-backed KV store to write values into a staging (temp) directory and then publish them via an atomic filesystem operation, reducing the chance of readers observing partially-written files.

Changes:

  • Added a .tmp staging directory plus unique temp-file naming for staged writes.
  • Reworked put to write into staging and then rename into place; updated directory scans to avoid descending into .tmp.
  • Added tests asserting staging is hidden from scans, cleaned up after writes, and not created by reads.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread monad-archive/src/kvstore/fs.rs
Comment thread monad-archive/src/kvstore/fs.rs
@eclark0426
eclark0426 force-pushed the ellis/fs-atomic-writes branch from b106bfb to 801f578 Compare August 28, 2026 18:50
@eclark0426
eclark0426 force-pushed the ellis/fs-atomic-writes branch from 801f578 to efa4582 Compare August 28, 2026 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants