Re: pg_upgrade bug found!

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Jeff Davis <pgsql(at)j-davis(dot)com>, RhodiumToad on IRC <andrew(at)tao11(dot)riddles(dot)org(dot)uk>, Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_upgrade bug found!
Date: 2011-04-08 00:14:18
Message-ID: 201104080014.p380EIF00645@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce Momjian wrote:
> > > Yes, it will be reasonable.
> > >
> > >> That means that VACUUM FREEZE of the toast table, if there are no
> > >> concurrent transactions, will freeze all of the tuples; and the
> > >> newFrozenXid should always be seen as newer than the existing (and
> > >> wrong) relfrozenxid. Then, it will set relfrozenxid to newFrozenXid and
> > >> everything should be fine. Right?
> > >
> > > Right.
> >
> > This depends on how soon after the upgrade VACUUM FREEZE is run,
> > doesn't it? If the XID counter has advanced too far...
>
> Well, I assume VACUUM FREEZE is going to sequential scan the table and
> replace every xid. If the clog is gone, well, we have problems. I
> think the IRC reporter pulled the clog files from a backup.

So I think we have four possible approaches to correct databases:

1) SELECT * to set the hint bits
2) VACUUM to set the hint bits
3) VACUUM FREEZE to remove the old xids
4) some complicated function

I don't like #4, and I think I can script #2 and #3 in psql by using COPY
to create a VACUUM script and then run it with \i. #1 is easy in a DO
block with PL/pgSQL.

--
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 Jeff Davis 2011-04-08 01:10:41 Re: pg_upgrade bug found!
Previous Message Roger Leigh 2011-04-07 23:24:44 Re: psql linestyle unicode and client encoding