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

Lines changed: 8 additions & 4 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy