Skip to content

paths: fsync after writing to a file#4892

Queued
kim wants to merge 10 commits intomasterfrom
kim/paths/fsync-after-write
Queued

paths: fsync after writing to a file#4892
kim wants to merge 10 commits intomasterfrom
kim/paths/fsync-after-write

Conversation

@kim
Copy link
Copy Markdown
Contributor

@kim kim commented Apr 24, 2026

As reported in #4886, metadata.toml can get get lost if the server crashes at an unfortunate point in time. To mitigate that, make path_type::write replace the file atomically, and issue fsync on the file and enclosing directory.

Expected complexity level and risk

1

As reported in #4886, `metadata.toml` can get get lost if the server
crashes at an unfortunate point in time. Do a textbook fsync to mitigate
that.

While not necessarily preventing the server from starting, the same is
advisable for any of the files, so the logic is put in the macro-
generated `write` method of typed paths.
@kim kim requested review from coolreader18 and jsdt April 24, 2026 11:28
@kim kim requested a review from gefjon April 28, 2026 11:00
@kim kim enabled auto-merge April 29, 2026 06:09
@kim kim disabled auto-merge April 30, 2026 14:55
@kim kim enabled auto-merge April 30, 2026 15:34
@kim kim added this pull request to the merge queue Apr 30, 2026
Any commits made after this event will not be merged.
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