Re: pg_upgrade < 9.3 -> >=9.3 misses a step around multixacts

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Andres Freund <andres(at)2ndquadrant(dot)com>, PostgreSQL Bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: pg_upgrade < 9.3 -> >=9.3 misses a step around multixacts
Date: 2014-07-02 19:32:55
Message-ID: 20140702193255.GB20463@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Tue, Jul 1, 2014 at 03:30:47PM -0400, Bruce Momjian wrote:
> > * When upgrading from 9.2 or older, all tables need to have relminmxid
> > set to oldestMulti. However, since pg_dump --binary-upgrade cannot
> > extract useful values from the catalog, we will need to have the
> > schema load create all tables with relminmxid=0. A subsequent UPDATE
> > will fix the values.
>
> OK, the updated attached patch does this. It repurposes
> set_frozenxids().

OK, patch applied back through 9.3. This leaves the two queries users
are going to have to run in 9.3.X. The first will tell users if they
should remove offsets/0000:

WITH list(file) AS
(
SELECT * FROM pg_ls_dir('pg_multixact/offsets')
)
SELECT EXISTS (SELECT * FROM list WHERE file = '0000') AND
NOT EXISTS (SELECT * FROM list WHERE file = '0001') AND
NOT EXISTS (SELECT * FROM list WHERE file = 'FFFF') AND
EXISTS (SELECT * FROM list WHERE file != '0000')
AS file_0000_removal_required;

The second will tell them if they should go to a wiki page that will
show them how to set database and relation minmxid values:

WITH list(file) AS
(
SELECT * FROM pg_ls_dir('pg_multixact/offsets')
)
SELECT EXISTS (SELECT * FROM list WHERE file ~ '^[8-9A-F]') AND
EXISTS (SELECT * FROM pg_database WHERE datminmxid = 1)
AS update_database_and_relation_minmxid;

I will work on the wiki page now.

I think this issue is now ready for 9.3.X, once we write the wiki page
and release note text.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ Everyone has their own god. +

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Burgess, Freddie 2014-07-02 20:04:27 Re: Postgresql 9.3.4 Streaming Replication Standby invalid Page block
Previous Message John R Pierce 2014-07-02 17:50:17 Re: