]> granicus.if.org Git - postgresql/commit
Allow on-line enabling and disabling of data checksums
authorMagnus Hagander <magnus@hagander.net>
Thu, 5 Apr 2018 19:57:26 +0000 (21:57 +0200)
committerMagnus Hagander <magnus@hagander.net>
Thu, 5 Apr 2018 20:04:48 +0000 (22:04 +0200)
commit1fde38beaa0c3e66c340efc7cc0dc272d6254bb0
tree1e8291cd8523789d919e239e92aa3ecd6aa749de
parentc39e903d510064e4415bbadb43e34f6998351cca
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
45 files changed:
doc/src/sgml/func.sgml
doc/src/sgml/ref/allfiles.sgml
doc/src/sgml/ref/initdb.sgml
doc/src/sgml/ref/pg_verify_checksums.sgml [new file with mode: 0644]
doc/src/sgml/reference.sgml
doc/src/sgml/wal.sgml
src/backend/access/rmgrdesc/xlogdesc.c
src/backend/access/transam/xlog.c
src/backend/access/transam/xlogfuncs.c
src/backend/catalog/system_views.sql
src/backend/postmaster/Makefile
src/backend/postmaster/bgworker.c
src/backend/postmaster/checksumhelper.c [new file with mode: 0644]
src/backend/postmaster/pgstat.c
src/backend/replication/basebackup.c
src/backend/replication/logical/decode.c
src/backend/storage/ipc/ipci.c
src/backend/storage/page/README
src/backend/storage/page/bufpage.c
src/backend/utils/misc/guc.c
src/bin/Makefile
src/bin/pg_upgrade/controldata.c
src/bin/pg_upgrade/pg_upgrade.h
src/bin/pg_verify_checksums/.gitignore [new file with mode: 0644]
src/bin/pg_verify_checksums/Makefile [new file with mode: 0644]
src/bin/pg_verify_checksums/pg_verify_checksums.c [new file with mode: 0644]
src/include/access/xlog.h
src/include/access/xlog_internal.h
src/include/catalog/catversion.h
src/include/catalog/pg_control.h
src/include/catalog/pg_proc.h
src/include/pgstat.h
src/include/postmaster/checksumhelper.h [new file with mode: 0644]
src/include/storage/bufpage.h
src/include/storage/checksum.h
src/test/Makefile
src/test/checksum/.gitignore [new file with mode: 0644]
src/test/checksum/Makefile [new file with mode: 0644]
src/test/checksum/README [new file with mode: 0644]
src/test/checksum/t/001_standby_checksum.pl [new file with mode: 0644]
src/test/isolation/expected/checksum_cancel.out [new file with mode: 0644]
src/test/isolation/expected/checksum_enable.out [new file with mode: 0644]
src/test/isolation/isolation_schedule
src/test/isolation/specs/checksum_cancel.spec [new file with mode: 0644]
src/test/isolation/specs/checksum_enable.spec [new file with mode: 0644]