Hacker News new | ask | show | jobs
by transactional 38 days ago
I strongly hope that the authors are actually using O_DSYNC|O_DIRECT, and not just the O_DIRECT they discuss. The post seems to conflate the 4KB atomicity (support for which is still hit or miss from drives I’ve checked) with 4KB writes being assuredly durable. If there is a write cache on the SSD/NVMe, which is common, one must either issue a FLUSH via fsync or have FUA set on the write via O_SYNC/O_DSYNC. Relying only on O_DIRECT is not a correct solution, as it assumes a drive with sufficient capacitors to always write out all cached data on failure, and that’s not a part of the required drive contract.