From 1fde38beaa0c3e66c340efc7cc0dc272d6254bb0 Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Thu, 5 Apr 2018 21:57:26 +0200 Subject: Allow on-line enabling and disabling of data checksums This makes it possible to turn checksums on in a live cluster, without the previous need for dump/reload or logical replication (and to turn it off). Enabling checkusm starts a background process in the form of a launcher/worker combination that goes through the entire database and recalculates checksums on each and every page. Only when all pages have been checksummed are they fully enabled in the cluster. Any failure of the process will revert to checksums off and the process has to be started. This adds a new WAL record that indicates the state of checksums, so the process works across replicated clusters. Authors: Magnus Hagander and Daniel Gustafsson Review: Tomas Vondra, Michael Banck, Heikki Linnakangas, Andrey Borodin --- doc/src/sgml/ref/allfiles.sgml | 1 + doc/src/sgml/ref/initdb.sgml | 6 +- doc/src/sgml/ref/pg_verify_checksums.sgml | 112 ++++++++++++++++++++++++++++++ 3 files changed, 116 insertions(+), 3 deletions(-) create mode 100644 doc/src/sgml/ref/pg_verify_checksums.sgml (limited to 'doc/src/sgml/ref') diff --git a/doc/src/sgml/ref/allfiles.sgml b/doc/src/sgml/ref/allfiles.sgml index 4e01e5641cf..7cd6ee85dc9 100644 --- a/doc/src/sgml/ref/allfiles.sgml +++ b/doc/src/sgml/ref/allfiles.sgml @@ -211,6 +211,7 @@ Complete list of usable sgml source files in this directory. + diff --git a/doc/src/sgml/ref/initdb.sgml b/doc/src/sgml/ref/initdb.sgml index 949b5a220f5..826dd91f729 100644 --- a/doc/src/sgml/ref/initdb.sgml +++ b/doc/src/sgml/ref/initdb.sgml @@ -195,9 +195,9 @@ PostgreSQL documentation Use checksums on data pages to help detect corruption by the I/O system that would otherwise be silent. Enabling checksums - may incur a noticeable performance penalty. This option can only - be set during initialization, and cannot be changed later. If - set, checksums are calculated for all objects, in all databases. + may incur a noticeable performance penalty. If set, checksums + are calculated for all objects, in all databases. See + for details. diff --git a/doc/src/sgml/ref/pg_verify_checksums.sgml b/doc/src/sgml/ref/pg_verify_checksums.sgml new file mode 100644 index 00000000000..463ecd5e1b3 --- /dev/null +++ b/doc/src/sgml/ref/pg_verify_checksums.sgml @@ -0,0 +1,112 @@ + + + + + pg_verify_checksums + + + + pg_verify_checksums + 1 + Application + + + + pg_verify_checksums + verify data checksums in an offline PostgreSQL database cluster + + + + + pg_verify_checksums + option + datadir + + + + + Description + + pg_verify_checksums verifies data checksums in a PostgreSQL + cluster. It must be run against a cluster that's offline. + + + + + Options + + + The following command-line options are available: + + + + + + + + Only validate checksums in the relation with specified relfilenode. + + + + + + + + + Force check even if checksums are disabled on cluster. + + + + + + + + + Enable debug output. Lists all checked blocks and their checksum. + + + + + + + + + + Print the pg_verify_checksums version and exit. + + + + + + + + + + Show help about pg_verify_checksums command line + arguments, and exit. + + + + + + + + + Notes + + Can only be run when the server is offline. + + + + + See Also + + + + + + + -- cgit v1.2.3