Torn page

A PostgreSQL data page which was not fully written by the underlying stack

A torn page (also referred to as a partial page write) occurs when PostgreSQL instructs the operating system to write out a full PostgreSQL data page (by default 8kb), but the operating system or an element of the underlying stack) splits the write into multiple units (e.g. two 4kb units, matching typical file system block size), but a system failure occurs before all parts of the data page write are fully completed.

PostgreSQL mitigates this problem by writing the entire page to WAL ("full-page write").

This behaviour is controlled by the GUC setting full_page_writes, which defaults to on. There is usually no need to change this parameter. Note that executing pg_start_backup() will force full_page_writes to be set to on in any case (see comment in src/backend/access/transam/xlog.c, function do_pg_start_backup() and commit 0a873949).


PostgreSQL internals, Storage