pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <bruce@momjian.us>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Andres Freund <andres@2ndquadrant.com>
Cc: PostgreSQL Bugs <pgsql-bugs@postgresql.org>
Subject: Re: pg_upgrade < 9.3 -> >=9.3 misses a step around multixacts
Date: Wed, 2 Jul 2014 15:32:55 -0400
Message-ID: <20140702193255.GB20463@momjian.us> (raw)
In-Reply-To: <20140701193047.GB16033@momjian.us>
References: <20140619015205.GD3806@momjian.us>
	<20140619014034.GC3806@momjian.us>
	<20140619220425.GQ18688@eldon.alvh.no-ip.org>
	<20140620010653.GS18688@eldon.alvh.no-ip.org>
	<20140620180725.GD29143@momjian.us>
	<20140624201346.GB17110@momjian.us>
	<20140627210520.GP7340@eldon.alvh.no-ip.org>
	<20140701161419.GA16033@momjian.us>
	<20140701190105.GA7340@eldon.alvh.no-ip.org>
	<20140701193047.GB16033@momjian.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + Everyone has their own god. +


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (78+ messages)  latest in thread

Message-ID: <20140702193255.GB20463@momjian.us>
Permalink:  ../20140702193255.GB20463@momjian.us/
Also on:    postgresql.org/message-id/20140702193255.GB20463@momjian.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: bruce@momjian.us, alvherre@2ndquadrant.com, andres@2ndquadrant.com
  Subject: Re: pg_upgrade < 9.3 -> >=9.3 misses a step around multixacts
  In-Reply-To: <20140702193255.GB20463@momjian.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox