Re: [HACKERS] Zeroing damaged pages

Поиск
Список
Период
Сортировка
Искать

Re: [HACKERS] Zeroing damaged pages

От:
Bruce Momjian <pgman@candle.pha.pa.us>
Дата:
Tom Lane wrote:
> Bruce Momjian  writes:
> >> On Thu, 2006-02-23 at 11:54 -0500, Tom Lane wrote:
> >>> Hmm .... it'd probably be a good idea to force zero_damaged_pages OFF in
> >>> the autovac subprocess.  That parameter is only intended for interactive
> >>> use --- as you say, autovac would be a rather nasty loose cannon if it
> >>> fired up with this parameter ON.
> 
> > I am wondering if we should prevent autovac from running if
> > zero_damaged_pages is set in postgresql.conf.
> 
> What's wrong with just turning it off locally in the autovac process?
> 
> If the admin prefers autovac not run at all while he's fooling around,
> he can disable it in postgresql.conf (or perhaps even better, run in
> single-user mode).  But I don't think it's appropriate to force that
> decision on him.

Done.

-- 
  Bruce Momjian   http://candle.pha.pa.us
  SRA OSS, Inc.   http://www.sraoss.com

  + If your life is a hard drive, Christ can be your backup. +
Index: src/backend/postmaster/autovacuum.c
===================================================================
RCS file: /cvsroot/pgsql/src/backend/postmaster/autovacuum.c,v
retrieving revision 1.12
diff -c -c -r1.12 autovacuum.c
*** src/backend/postmaster/autovacuum.c	5 Mar 2006 15:58:35 -0000	1.12
--- src/backend/postmaster/autovacuum.c	6 Mar 2006 05:10:23 -0000
***************
*** 125,130 ****
--- 125,133 ----
  	if (!AutoVacuumingActive())
  		return 0;
  
+ 	/* Even if zero_damaged_pages is true, we don't want autovacuum zeroing. */
+ 	zero_damaged_pages = false;
+ 
  	/*
  	 * Do nothing if too soon since last autovacuum exit.  This limits how
  	 * often the daemon runs.  Since the time per iteration can be quite

Re: [HACKERS] Zeroing damaged pages

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Bruce Momjian  writes:
  
> + 	/* Even if zero_damaged_pages is true, we don't want autovacuum zeroing. */
> + 	zero_damaged_pages = false;

This is completely incorrect; you need to set the variable via GUC, else
it will still be overridden from postgresql.conf if a SIGHUP arrives.
I believe this would work:

	SetConfigOption("zero_damaged_pages", "false",
			PGC_SUSET, PGC_S_SESSION);

			regards, tom lane

Re: [HACKERS] Zeroing damaged pages

От:
Bruce Momjian <pgman@candle.pha.pa.us>
Дата:
Tom Lane wrote:
> Bruce Momjian  writes:
>   
> > + 	/* Even if zero_damaged_pages is true, we don't want autovacuum zeroing. */
> > + 	zero_damaged_pages = false;
> 
> This is completely incorrect; you need to set the variable via GUC, else
> it will still be overridden from postgresql.conf if a SIGHUP arrives.
> I believe this would work:
> 
> 	SetConfigOption("zero_damaged_pages", "false",
> 			PGC_SUSET, PGC_S_SESSION);

Done.

-- 
  Bruce Momjian   http://candle.pha.pa.us
  SRA OSS, Inc.   http://www.sraoss.com

  + If your life is a hard drive, Christ can be your backup. +
FAQ