Skip to content

Fsync the parent directory after compact rename - #14

Merged
jaredLunde merged 3 commits into
beyondoss:mainfrom
paulocsanz:dst/compact-dir-fsync
Aug 14, 2026
Merged

Fsync the parent directory after compact rename#14
jaredLunde merged 3 commits into
beyondoss:mainfrom
paulocsanz:dst/compact-dir-fsync

Conversation

@paulocsanz

Copy link
Copy Markdown
Contributor

compact_to_file fsynced the inode then persist() (rename) without fsyncing the parent directory. Power loss can drop the new dirent. artifact::rename_into_place already closes this hole. Two commits: tests that fail on main, then the fix.

  • fsync_dir is pub(crate) and called after compact persist.

artifact::rename_into_place already fsyncs the parent after rename.
compact_to_file is the fold's durable publish and currently does not.
persist() is rename(2). The inode is durable; the new dirent is not
until the parent is fsynced. Reuse artifact::fsync_dir.
@jaredLunde
jaredLunde merged commit b9466bb into beyondoss:main Aug 14, 2026
1 check passed
@jaredLunde jaredLunde mentioned this pull request Aug 16, 2026
jaredLunde added a commit that referenced this pull request Aug 16, 2026
* chore: bump to 0.7.3 — durability fixes since 0.7.2

Ship the four post-0.7.2 snapshot/watch fixes to crates.io:
- #13 snapshot load must not drop a durable tail
- #14 fsync parent directory after compact rename
- #15 refuse watch resume at u64::MAX (no wrap to 0)
- #16 mid-file NULs must not drop a CRC-valid suffix

Also refresh README install snippets from 0.5 → 0.7.

Co-authored-by: Jared Lunde <jared.lunde@gmail.com>

* chore: sync Cargo.lock package version to 0.7.3

Co-authored-by: Jared Lunde <jared.lunde@gmail.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
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