Cached and Durable Writes
A write can become visible to a subsequent process before it has reached persistent storage. The operating system and storage need explicit guarantees for recovery after a crash.
- Source
- Anbloq
- Language
- English
- Created
- Updated
- Chapters
- 4
- Reading time
- 1 min
In this article4 chapters
Trace a save action
An application can flush its buffered writer and then read the new result. That demonstrates visibility through its chosen interface. It does not by itself show the bytes survive loss of power. See flushing.
Check the full update
When replacing a file, the data and the name update may have separate durability concerns. Use the supported platform semantics. Durable ordering explains why the order matters.[1]
Trace what an acknowledgement guarantees
A file write can succeed from the application's perspective while data remains buffered by user space, the kernel or hardware. A synchronization operation supplies stronger persistence according to the filesystem and device contract. State what should survive a crash or power loss. See flushing buffered output.
Stage 1: write accepted by program buffer
Stage 2: bytes passed through OS interface
Stage 3: durability operation completed under documented guarantees
Verify the entire publication path
A replacement operation can change directory metadata as well as file contents. Durability requirements can therefore include more than syncing the file. Test successful output through a reader and treat crash recovery as a distinct test.