Re: pg_upgrade bug found!

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: bricklen <bricklen(at)gmail(dot)com>
Cc: Stephen Frost <sfrost(at)snowman(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_upgrade bug found!
Date: 2011-04-09 03:24:45
Message-ID: 201104090324.p393OjK22801@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

bricklen wrote:
> On Fri, Apr 8, 2011 at 8:07 PM, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
> > Stephen Frost wrote:
> > -- Start of PGP signed section.
> >> bricklen,
> >>
> >> * bricklen (bricklen(at)gmail(dot)com) wrote:
> >> > Now, is this safe to run against my production database?
> >>
> >> Yes, with a few caveats. ?One recommendation is to also increase
> >> autovacuum_freeze_max_age to 500000000 (500m), which will hopefully
> >> prevent autovacuum from 'butting in' and causing issues during the
> >> process. ?Also, a database-wide 'VACUUM FREEZE;' should be lower-risk,
> >> if you can afford it (it will cause a lot of i/o on the system). ?The
> >> per-table 'VACUUM FREEZE <table>;' that the script does can end up
> >> removing clog files prematurely.
> >>
> >> > Anyone have any suggestions or changes before I commit myself to this
> >> > course of action?
> >>
> >> If you run into problems, and perhaps even before starting, you may want
> >> to pop in to #postgresql on irc.freenode.net, there are people there who
> >> can help you with this process who are very familiar with PG.
> >
> > Stephen is 100% correct and we have updated the wiki to explain recovery
> > details:
> >
> > ? ? ? ?http://wiki.postgresql.org/wiki/20110408pg_upgrade_fix
> >
>
> Thanks guys, I really appreciate your help. For the vacuum freeze, you
> say database-wide, should I run vacuumdb -a -v -F ? Will freezing the
> other tables in the cluster help (not sure how that works with
> template0/1 databases?)

Exactly. Internally pg_upgrade uses:

vacuumdb --all --freeze

in the empty new cluster to remove any links to pg_clog files (because
we copy the old pg_clog files into the new cluster directory). (This is
proof that the old and new clog files are the same format.) If you run
vacuumdb as above in the new cluster, it will again remove any
requirement on pg_clog, which is our goal.

--
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 Oleg Bartunov 2011-04-09 03:38:23 Re: k-neighbourhood search in databases
Previous Message Stephen Frost 2011-04-09 03:24:34 Re: pg_upgrade bug found!