PostgreSQL reliability - GradedJestRisk/db-training GitHub Wiki
Reliability
cache
PostgreSQL goes into recovery mode if any of its process (maintenance or backup) exit with an error, as it may have :
- corrupted the cache;
- write erroneous data to disk.
data file
When a block is read, its checksum is compared to the checksum stored in its header.
checksums, enabled by default starting v18
write anomaly
Page-level atomicity.
PostgreSQL always ask to write 8kb of data to disk, but the disk controller may have a different block size. If it requires, says, 10 disk block to accommodate 1 database block, and the write fails at the second block, the database block is lost. This is a "torn write". But, because it has also been written down on the WAL,