Re: 9.3beta2: Failure to pg_upgrade

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Jesse Denardo <denaje(at)gmail(dot)com>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, pgsql-bugs(at)postgresql(dot)org, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 9.3beta2: Failure to pg_upgrade
Date: 2013-07-31 20:55:33
Message-ID: 20130731205532.GA14652@eldon.alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

Jesse Denardo escribió:

> $ 9.2_dev/bin/pg_controldata data

> Latest checkpoint's NextMultiXactId: 2982
> Latest checkpoint's NextMultiOffset: 6479

So what's happening here is that the MultiXact 2982 lives in a SLRU page
that doesn't exist. pg_upgrade didn't copy the pg_multixact files from
the old cluster, because they are not compatible; instead it just sets
the values in pg_control. As soon as a new multixact is to be created,
things fail because the code is not prepared to deal with the
possibility that the underlying SLRU files have not been extended during
normal operation.

I see two ways to deal with this:

1. On each multixact creation, verify whether the pages we're trying to
modify do in fact exist. If they don't, create them.

2. At startup, verify the "next" multixact values, and extend the files
if necessary.

I think (1) is not a very good idea because it will cause too large an
impact at runtime, when it is not really necessary. I lean more towards
(2). On IM, Bruce suggested instead:

2a. Same as (2), but only do it in pg_upgrade's usage of postgres'
binary-upgrade mode (postgres -b). Thus this will be done once during
the upgrade process and not every time the system starts up.

As it turns out, I have a patched slru.c that adds a new function to
verify whether a page exists on disk. I created this for the commit
timestamp module, for the BDR branch, but I think it's what we need
here.

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message f-s@libero.it 2013-07-31 21:13:09 postgresql 8.4 on android table with debian installed (Debian Kit APK)
Previous Message Jesse Denardo 2013-07-31 17:18:31 Re: 9.3beta2: Failure to pg_upgrade

Browse pgsql-hackers by date

  From Date Subject
Next Message MauMau 2013-07-31 22:37:58 Re: [9.3 bug] disk space in pg_xlog increases during archive recovery
Previous Message Antonin Houska 2013-07-31 20:50:19 Re: Backup throttling