Re: Manual anti-wraparound vacuums

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Manual anti-wraparound vacuums
Date: 2011-11-11 20:14:53
Message-ID: 201111112014.pABKErq22191@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Heikki Linnakangas wrote:
> On 11.11.2011 17:47, Tom Lane wrote:
> > Robert Haas<robertmhaas(at)gmail(dot)com> writes:
> >> On Fri, Nov 11, 2011 at 9:59 AM, Tom Lane<tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> >>> It occurs to me to wonder how this scenario will interact with the
> >>> recent changes to let VACUUM skip pages. AFAIR there is not a way for a
> >>> manual VACUUM to set the anti-wraparound mode, is there?
> >
> >> I tweaked Simon's original patch to address exactly this scenario;
> >> VACUUM FREEZE prevents page-skipping behavior.
> >
> > That doesn't address my concern. (1) The manual does not say you must
> > use VACUUM FREEZE for this, nor do the HINT messages. (2) You probably
> > wouldn't want to use VACUUM FREEZE, as that could force a great deal
> > more I/O than might be necessary to fix the problem.
>
> set vacuum_freeze_table_age=0; VACUUM;
>
> will do the trick.
>
> > (3) In disaster
> > recovery scenarios, the last thing we want is to be imposing extra
> > conditions on what an already-stressed DBA has to do to fix things;
> > especially extra conditions that are different from the way it's worked
> > for the last ten years.
>
> True.
>
> > And there's also (4) if someone is doing a
> > manual VACUUM, they might well wish the table to be completely vacuumed,
> > not just sort of.
> >
> > I think we'd be better advised to restrict the page-skipping behavior
> > to autovacuums, period, and remove the connection to FREEZE.
>
> Yeah, I think you're right. We can accomplish that by setting the
> default vacuum_freeze_age to 0. That way it's still possible to get the
> page-skipping behavior in manual VACUUMs by setting it to non-zero, but
> you get a full scan by default.

FYI, pg_upgrade needs to use vacuum freeze to remove all references to
pg_clog because the files are coming from the old cluster. If we change
that, pg_upgrade needs to be adjusted.

--
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

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Treat 2011-11-11 20:18:43 Working with git repo tagged versions
Previous Message Bruce Momjian 2011-11-11 20:11:42 Re: Disable OpenSSL compression