Torn write
A torn write is an interrupted write that persists only part of its intended update, potentially leaving a database page with mixed old and new contents.
A database page may span several storage write units, so a page write cannot automatically be treated as atomic. PostgreSQL documents full-page images as protection for recovery from this failure. Transaction atomicity and page-write atomicity describe different boundaries. Torn-write protection permits the complete old value instead of a mixture; it does not by itself make the replacement durable. Linux RWF_ATOMIC requests this protection for one supported direct-I/O range.
Relations
- related
- full-page-write, write-ahead-log, crash-consistency, power-loss-protection, rwf-atomic, statx-write-atomic, raid-write-hole, lost-write
Limitations
- A transaction log containing only change records may not reconstruct a partially written page. [2]