Re: pg_upgrade bug found!

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Jeff Davis <pgsql(at)j-davis(dot)com>
Cc: Noah Misch <noah(at)leadboat(dot)com>, RhodiumToad on IRC <andrew(at)tao11(dot)riddles(dot)org(dot)uk>, Robert Haas <robertmhaas(at)gmail(dot)com>, 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 17:24:10
Message-ID: 201104081724.p38HOAZ16185@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Jeff Davis wrote:
> On Thu, 2011-04-07 at 22:21 -0400, Bruce Momjian wrote:
> > One concern I have is that existing heap tables are protecting clog
> > files, but once those are frozen, the system might remove clog files not
> > realizing it has to freeze the heap tables too.
>
> I don't understand. Can you elaborate?

Well, when you initially run pg_upgrade, your heap relfrozenxid is
preserved, and we only remove clog files when _all_ relations in all
database do not need them, so for a time the heap tables will keep the
clogs around. Over time, the heap files will be vacuum frozen, and
their relfrozenxid advanced. Once that happens to all heaps, the system
thinks it can remove clog files, and doesn't realize the toast tables
also need vacuuming. This is the "it might become more of a problem in
the future" concern I have. The script I posted does fix this, and the
code changes prevent it from happening completely.

--
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 Bruce Momjian 2011-04-08 17:26:13 Re: pg_upgrade bug found!
Previous Message Bruce Momjian 2011-04-08 17:19:32 Re: pg_upgrade bug found!