Dashboardinstitutional-transition-lab_atomic_write directory fsync

_atomic_write directory fsync

Category: gotcha
Confidence: 1.00
ID: 01a0843e-bba6-7ad9-9332-49a2aea9d6a0
Project ID: 1fa3712f-997f-4884-b7ec-8abb79f9e342
Cross-project: No
Recalled in other projects: 0
Source session: 0sYM3EtB7rSNFj77g
Created: 2026-09-09 03:35:53
Updated: 2026-09-09 03:38:18

Content

Trap: fsyncing a temporary file before os.replace() looks crash-safe because file contents are durable, but the renamed directory entry is not durable and a crash can restore an old open summary. Fix: replace through the validated parent directory and fsync that directory after rename; regression instrumentation must observe file fsync, replacement, then parent-directory fsync.

Move to: