16, 11 chapters
WAL and recovery
everything.wal
WAL and recovery
write-ahead logging, LSNs, checkpoints, crash recovery, backups and replication.
- 16.01the write-ahead rulelog first, data later. why a commit only has to write one small sequential thing.
- 16.02WAL records and LSNspg_walinspect on a real INSERT: record types, lengths, and the blocks each record touches.
- 16.03what COMMIT waits forthe commit record, the flush, group commit, and what synchronous_commit = off really risks.
- 16.04torn pages and full-page writesan 8 KB page, a 4 KB disk write, and why the first change after a checkpoint logs the whole page.
- 16.05checkpointsflushing dirty pages, the redo pointer, and the trade between recovery time and steady I/O.
- 16.06crash recoverykill the server, restart, replay from the redo pointer. pages newer than a record get skipped.
- 16.07ARIESanalysis, redo, undo. the textbook recovery algorithm, and why postgres only needs the middle pass.
- 16.08data checksumson by default since postgres 18. what a checksum catches, and what it can't.
- 16.09backups and point-in-time recoverypg_dump vs base backups, WAL archiving, and restoring to 14:31:59, the second before the mistake.
- 16.10streaming replicationa standby replaying WAL as it arrives. lag, hot standby conflicts, and synchronous replicas.
- 16.11logical replication and decodingshipping row changes instead of page changes. publications, slots, and change data capture.