From a228cc13aeabff308d6dfc98a1015865f5393fce Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Mon, 9 Apr 2018 19:02:42 +0200 Subject: Revert "Allow on-line enabling and disabling of data checksums" This reverts the backend sides of commit 1fde38beaa0c3e66c340efc7cc0dc272d6254bb0. I have, at least for now, left the pg_verify_checksums tool in place, as this tool can be very valuable without the rest of the patch as well, and since it's a read-only tool that only runs when the cluster is down it should be a lot safer. --- doc/src/sgml/func.sgml | 65 ----------------------------------- doc/src/sgml/ref/initdb.sgml | 6 ++-- doc/src/sgml/reference.sgml | 1 - doc/src/sgml/wal.sgml | 81 -------------------------------------------- 4 files changed, 3 insertions(+), 150 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index 3bf21477adb..53a40ddeecf 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -19566,71 +19566,6 @@ postgres=# SELECT * FROM pg_walfile_name_offset(pg_stop_backup()); - - Data Checksum Functions - - - The functions shown in can - be used to enable or disable data checksums in a running cluster. - See for details. - - - - Checksum <acronym>SQL</acronym> Functions - - - - Function - Return Type - Description - - - - - - - pg_enable_data_checksums - - pg_enable_data_checksums(cost_delay int, cost_limit int) - - - void - - - - Initiates data checksums for the cluster. This will switch the data checksums mode - to in progress and start a background worker that will process - all data in the database and enable checksums for it. When all data pages have had - checksums enabled, the cluster will automatically switch to checksums - on. - - - If cost_delay and cost_limit are - specified, the speed of the process is throttled using the same principles as - Cost-based Vacuum Delay. - - - - - - - pg_disable_data_checksums - - pg_disable_data_checksums() - - - void - - - Disables data checksums for the cluster. - - - - -
- -
- Database Object Management Functions diff --git a/doc/src/sgml/ref/initdb.sgml b/doc/src/sgml/ref/initdb.sgml index 10a8a86a030..feefd9a41e0 100644 --- a/doc/src/sgml/ref/initdb.sgml +++ b/doc/src/sgml/ref/initdb.sgml @@ -214,9 +214,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. If set, checksums - are calculated for all objects, in all databases. See - for details. + 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. diff --git a/doc/src/sgml/reference.sgml b/doc/src/sgml/reference.sgml index 78c214f1b08..ef2270c4673 100644 --- a/doc/src/sgml/reference.sgml +++ b/doc/src/sgml/reference.sgml @@ -284,7 +284,6 @@ &pgtestfsync; &pgtesttiming; &pgupgrade; - &pgVerifyChecksums; &pgwaldump; &postgres; &postmaster; diff --git a/doc/src/sgml/wal.sgml b/doc/src/sgml/wal.sgml index 6249cb41361..f4bc2d4161e 100644 --- a/doc/src/sgml/wal.sgml +++ b/doc/src/sgml/wal.sgml @@ -230,87 +230,6 @@ - - Data checksums - - checksums - - - - Data pages are not checksum protected by default, but this can optionally be enabled for a cluster. - When enabled, each data page will be assigned a checksum that is updated when the page is - written and verified every time the page is read. Only data pages are protected by checksums, - internal data structures and temporary files are not. - - - - Checksums are normally enabled when the cluster is initialized using - initdb. They - can also be enabled or disabled at runtime. In all cases, checksums are enabled or disabled - at the full cluster level, and cannot be specified individually for databases or tables. - - - - The current state of checksums in the cluster can be verified by viewing the value - of the read-only configuration variable by - issuing the command SHOW data_checksums. - - - - When attempting to recover from corrupt data it may be necessary to bypass the checksum - protection in order to recover data. To do this, temporarily set the configuration parameter - . - - - - On-line enabling of checksums - - - Checksums can be enabled or disabled online, by calling the appropriate - functions. - Disabling of checksums takes effect immediately when the function is called. - - - - Enabling checksums will put the cluster in inprogress mode. - During this time, checksums will be written but not verified. In addition to - this, a background worker process is started that enables checksums on all - existing data in the cluster. Once this worker has completed processing all - databases in the cluster, the checksum mode will automatically switch to - on. - - - - The process will initially wait for all open transactions to finish before - it starts, so that it can be certain that there are no tables that have been - created inside a transaction that has not committed yet and thus would not - be visible to the process enabling checksums. It will also, for each database, - wait for all pre-existing temporary tables to get removed before it finishes. - If long-lived temporary tables are used in the application it may be necessary - to terminate these application connections to allow the process to complete. - Information about open transactions and connections with temporary tables is - written to log. - - - - If the cluster is stopped while in inprogress mode, for - any reason, then this process must be restarted manually. To do this, - re-execute the function pg_enable_data_checksums() - once the cluster has been restarted. It is not possible to resume the work, - the process has to start over and re-process the cluster. - - - - - Enabling checksums can cause significant I/O to the system, as most of the - database pages will need to be rewritten, and will be written both to the - data files and the WAL. - - - - - - Write-Ahead Logging (<acronym>WAL</acronym>) -- cgit v1.2.3