SQLite Forum

sector flush atomic
Login
A partial write to a single sector or of a filesystem block (consisting of multiple sectors) is called a torn write.  

Torn write handling is also described in the documentation and found here <https://sqlite.org/atomiccommit.html> for the standard journal mode.  There are links on that page to how torn page / torn block errors are handled when using write-ahead logging.

SQLite3 basically makes no distinction between a torn write which renders a sector unreadable due to corruption of the hardware FEC and CRC data and a torn write which occurs on a sector boundary within a filesystem block (which cannot be detected by the hardware) but takes precautions effective against both simultaneously.

There is a capability for the underlying OS to indicate that it is tear-proof but correctly implementing tear-proof storage is very expensive so very few OS's or filesystems even bother to indicate it even if it is present.