Menu

PostgreSQL torn-page detection and protection
📰

PostgreSQL torn-page detection and protection

DEV Community: database·Franck Pachot·3 days ago
#qagBxc8F
#devtodatabase#devto#dev#recovery#postgres
Long article (4624 words) — no AI summary yet.
Reading 0:00
15s threshold

My DBA career began with Oracle Database, where recovery is traditionally divided into two failure scenarios: instance failure and media failure.

Instance recovery (called restart recovery in the ARIES paper ) assumes database files remain physically valid. A server, operating system, or database instance stops unexpectedly, leaving pages at different points in time. Transaction logs contain the information needed to restore consistency.

Media recovery assumes stored data is unusable: a datafile or block is lost or corrupted. Recovery requires another valid copy, usually from a backup, replica, or other redundant storage.

This distinction is fundamental and clearly defined in the ARIES paper . Instance recovery uses the current online files ( nonvolatile database and log ) that remain after a crash, while media recovery uses restored copies ( image copy ) when the original storage is damaged.

A torn page falls between these cases.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.