Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit e6107da

Browse files
committed
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).
1 parent 8d51c27 commit e6107da

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/backend/postmaster/autovacuum.c

+8-4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
*
1212
* IDENTIFICATION
13-
* $PostgreSQL: pgsql/src/backend/postmaster/autovacuum.c,v 1.14 2006/03/07 03:03:09 momjian Exp $
13+
* $PostgreSQL: pgsql/src/backend/postmaster/autovacuum.c,v 1.15 2006/03/07 17:32:22 tgl Exp $
1414
*
1515
*-------------------------------------------------------------------------
1616
*/
@@ -125,9 +125,6 @@ autovac_start(void)
125125
if (!AutoVacuumingActive())
126126
return 0;
127127

128-
/* Even if zero_damaged_pages is true, we don't want autovacuum zeroing. */
129-
SetConfigOption("zero_damaged_pages", "false", PGC_SUSET, PGC_S_SESSION);
130-
131128
/*
132129
* Do nothing if too soon since last autovacuum exit. This limits how
133130
* often the daemon runs. Since the time per iteration can be quite
@@ -307,6 +304,13 @@ AutoVacMain(int argc, char *argv[])
307304

308305
PG_SETMASK(&UnBlockSig);
309306

307+
/*
308+
* Force zero_damaged_pages OFF in the autovac process, even if it is
309+
* set in postgresql.conf. We don't really want such a dangerous option
310+
* being applied non-interactively.
311+
*/
312+
SetConfigOption("zero_damaged_pages", "false", PGC_SUSET, PGC_S_OVERRIDE);
313+
310314
/* Get a list of databases */
311315
dblist = autovac_get_database_list();
312316

0 commit comments

Comments
 (0)