Re: Patch for pg_upgrade to turn off autovacuum

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Jeff Davis <pgsql(at)j-davis(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch for pg_upgrade to turn off autovacuum
Date: 2011-04-21 21:52:33
Message-ID: 201104212152.p3LLqYY05266@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce Momjian wrote:
> Bruce Momjian wrote:
> > Robert Haas wrote:
> > > On Thu, Mar 31, 2011 at 12:11 PM, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
> > > > Robert Haas wrote:
> > > >> On Thu, Mar 31, 2011 at 11:32 AM, Heikki Linnakangas
> > > >> <heikki(dot)linnakangas(at)enterprisedb(dot)com> wrote:
> > > >> >> ?I think the maintenance
> > > >> >> overhead of an invisible variable is too much.
> > > >> >
> > > >> > A simple GUC or command-line switch isn't much code.
> > > >>
> > > >> I like the idea of a command-line switch.
> > > >
> > > > If you want to do that you should gereralize it as --binary-upgrade in
> > > > case we have other needs for it.
> > >
> > > Yeah. Or we could do a binary_upgrade GUC which has the effect of
> > > forcibly suppressing autovacuum, and maybe other things later. I
> > > think that's a lot less hazardous than fiddling with the autovacuum
> > > GUC.
> >
> > I like the idea of a command-line flag because it forces everything to
> > be affected, and cannot be turned on and off in sessions --- if you are
> > doing a binary upgrade, locked-down is good. :-)
>
> The attached patch adds a new postmaster/postgres binary upgrade mode
> (-b) which disables autovacuum, allows only super-user connections, and
> prevents pg_upgrade_support oid assignment when not in upgrade mode.
> It also modifies pg_upgrade to use this new mode rather than play with
> trying to stop autovacuum.
>
> This does fix a very rare bug that could happen if
> autovacuum_freeze_max_age were set to maximum by the user.
>
> I think this should be applied to PG 9.1.

One big problem with this patch is that it will not allow people to use
pg_upgrade when upgrading from 9.1 alpha to beta. What I could do is to
use the mode only on the "new" cluster for 9.1.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2011-04-21 21:52:35 Re: EOL for 8.2 (was Re: Formatting Curmudgeons WAS: MMAP Buffers)
Previous Message Peter Eisentraut 2011-04-21 21:49:47 Re: EOL for 8.2 (was Re: Formatting Curmudgeons WAS: MMAP Buffers)