The real experience
The real experience
Posted Feb 21, 2025 6:12 UTC (Fri) by butlerm (subscriber, #13312)In reply to: The real experience by ikm
Parent article: Support for atomic block writes in 6.13
Most physical spinning rust style hard drives that I am aware of these days have 4 KB sector sizes, and most SSDs have 128 KB page sizes. In the case of the former ideally you would have 4 KB database data block sizes as well, but most databases have been using a default block size of 8192 bytes or more for some time now so they presumably account for that possibility. And a typical way that is done is to store an adequate checksum and block id of some kind inline with the database data block so that a torn write or other unusual write failure or memory corruption can be detected when the block is next processed or read back in. Some filesystems like zfs of course do something quite similar, with block checksums or secure hashes stored with all or almost all internal block pointers. SHA-256 and CRC-32c are typically supported with CPU instructions on most modern enterprise class hardware so that isn't too difficult or too slow.