diff options
author | Magnus Hagander <magnus@hagander.net> | 2018-04-09 19:02:42 +0200 |
---|---|---|
committer | Magnus Hagander <magnus@hagander.net> | 2018-04-09 19:03:42 +0200 |
commit | a228cc13aeabff308d6dfc98a1015865f5393fce (patch) | |
tree | 4704837fb075ccf7c8e5ecc10f341e527ed0e16d /src/backend/access/transam/xlogfuncs.c | |
parent | 03c11796a95cc20a4559a103019d4d22a116a13c (diff) | |
download | postgresql-a228cc13aeabff308d6dfc98a1015865f5393fce.tar.gz postgresql-a228cc13aeabff308d6dfc98a1015865f5393fce.zip |
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.
Diffstat (limited to 'src/backend/access/transam/xlogfuncs.c')
-rw-r--r-- | src/backend/access/transam/xlogfuncs.c | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/src/backend/access/transam/xlogfuncs.c b/src/backend/access/transam/xlogfuncs.c index b76b2688911..316edbe3c58 100644 --- a/src/backend/access/transam/xlogfuncs.c +++ b/src/backend/access/transam/xlogfuncs.c @@ -24,7 +24,6 @@ #include "catalog/pg_type.h" #include "funcapi.h" #include "miscadmin.h" -#include "postmaster/checksumhelper.h" #include "replication/walreceiver.h" #include "storage/smgr.h" #include "utils/builtins.h" @@ -699,61 +698,3 @@ pg_backup_start_time(PG_FUNCTION_ARGS) PG_RETURN_DATUM(xtime); } - -/* - * Disables checksums for the cluster, unless already disabled. - * - * Has immediate effect - the checksums are set to off right away. - */ -Datum -disable_data_checksums(PG_FUNCTION_ARGS) -{ - /* - * If we don't need to write new checksums, then clearly they are already - * disabled. - */ - if (!DataChecksumsNeedWrite()) - ereport(ERROR, - (errmsg("data checksums already disabled"))); - - ShutdownChecksumHelperIfRunning(); - - SetDataChecksumsOff(); - - PG_RETURN_VOID(); -} - -/* - * Enables checksums for the cluster, unless already enabled. - * - * Supports vacuum-like cost-based throttling, to limit system load. - * Starts a background worker that updates checksums on existing data. - */ -Datum -enable_data_checksums(PG_FUNCTION_ARGS) -{ - int cost_delay = PG_GETARG_INT32(0); - int cost_limit = PG_GETARG_INT32(1); - - if (cost_delay < 0) - ereport(ERROR, - (errmsg("cost delay cannot be less than zero"))); - if (cost_limit <= 0) - ereport(ERROR, - (errmsg("cost limit must be a positive value"))); - - /* - * Allow state change from "off" or from "inprogress", since this is how - * we restart the worker if necessary. - */ - if (DataChecksumsNeedVerify()) - ereport(ERROR, - (errmsg("data checksums already enabled"))); - - SetDataChecksumsInProgress(); - if (!StartChecksumHelperLauncher(cost_delay, cost_limit)) - ereport(ERROR, - (errmsg("failed to start checksum helper process"))); - - PG_RETURN_VOID(); -} |