Turn off zero_damaged_pages in the right place (ie, in the autovac
process not in the postmaster) and with the right GucSource (needs to be a nontransactional source since we've not started an xact yet).
This commit is contained in:
parent
8d51c276ca
commit
e6107da53c
|
@ -10,7 +10,7 @@
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/postmaster/autovacuum.c,v 1.14 2006/03/07 03:03:09 momjian Exp $
|
* $PostgreSQL: pgsql/src/backend/postmaster/autovacuum.c,v 1.15 2006/03/07 17:32:22 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
@ -125,9 +125,6 @@ autovac_start(void)
|
||||||
if (!AutoVacuumingActive())
|
if (!AutoVacuumingActive())
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* Even if zero_damaged_pages is true, we don't want autovacuum zeroing. */
|
|
||||||
SetConfigOption("zero_damaged_pages", "false", PGC_SUSET, PGC_S_SESSION);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Do nothing if too soon since last autovacuum exit. This limits how
|
* Do nothing if too soon since last autovacuum exit. This limits how
|
||||||
* often the daemon runs. Since the time per iteration can be quite
|
* often the daemon runs. Since the time per iteration can be quite
|
||||||
|
@ -307,6 +304,13 @@ AutoVacMain(int argc, char *argv[])
|
||||||
|
|
||||||
PG_SETMASK(&UnBlockSig);
|
PG_SETMASK(&UnBlockSig);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Force zero_damaged_pages OFF in the autovac process, even if it is
|
||||||
|
* set in postgresql.conf. We don't really want such a dangerous option
|
||||||
|
* being applied non-interactively.
|
||||||
|
*/
|
||||||
|
SetConfigOption("zero_damaged_pages", "false", PGC_SUSET, PGC_S_OVERRIDE);
|
||||||
|
|
||||||
/* Get a list of databases */
|
/* Get a list of databases */
|
||||||
dblist = autovac_get_database_list();
|
dblist = autovac_get_database_list();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue