Re: [PATCHES] [HACKERS] Zeroing damaged pages

2006-03-06 Thread Bruce Momjian
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. +

---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org


Re: [PATCHES] [HACKERS] Zeroing damaged pages

2006-03-06 Thread Tom Lane
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

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
   subscribe-nomail command to [EMAIL PROTECTED] so that your
   message can get through to the mailing list cleanly


Re: [PATCHES] [HACKERS] Zeroing damaged pages

2006-03-05 Thread Bruce Momjian
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 -   1.12
--- src/backend/postmaster/autovacuum.c 6 Mar 2006 05:10:23 -
***
*** 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

---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org