pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <bruce@momjian.us>
To: depesz@depesz.com
Cc: PostgreSQL-development <pgsql-hackers@postgreSQL.org>
Subject: Re: [GENERAL] pg_upgrade problem
Date: Wed, 31 Aug 2011 13:23:05 -0400 (EDT)
Message-ID: <201108311723.p7VHN5m16754@momjian.us> (raw)
In-Reply-To: <20110829174924.GA14101@depesz.com>

hubert depesz lubaczewski wrote:
> INFO:  vacuuming "pg_toast.pg_toast_106668498"
> vacuumdb: vacuuming of database "etsy_v2" failed: ERROR:  could not access status of transaction 3429738606
> DETAIL:  Could not open file "pg_clog/0CC6": No such file or directory.
> 
> Interestingly.
> 
> In old dir there is pg_clog directory with files:
> 0AC0 .. 0DAF (including 0CC6, size 262144)
> but new pg_clog has only:
> 0D2F .. 0DB0
> 
> File content - nearly all files that exist in both places are the same, with exception of 2 newest ones in new datadir:
> 3c5122f3e80851735c19522065a2d12a  0DAF
> 8651fc2b9fa3d27cfb5b496165cead68  0DB0
> 
> 0DB0 doesn't exist in old, and 0DAF has different md5sum: 7d48996c762d6a10f8eda88ae766c5dd
> 
> one more thing. I did select count(*) from transactions and it worked.

Count(*) worked because it didn't access any of the long/toasted values.

> that's about it. I can probably copy over files from old datadir to new (in
> pg_clog/), and will be happy to do it, but I'll wait for your call - retry with
> copies files might destroy some evidence.

You can safely copy over any of the clog files that exist in the old
cluster but not in the new one, but another vacuum is likely to remove
those files again.  :-(

This sure sounds like a variation on the pg_upgrade/toast bug we fixed
in 9.0.4:

	http://wiki.postgresql.org/wiki/20110408pg_upgrade_fix

Can you get me the 9.0.X pg_class.relfrozenxid for the toast and heap
tables involved?

FYI, this is what pg_dump --binary-upgrade does to preserve the
relfrozenxids:

	-- For binary upgrade, set heap's relfrozenxid
	UPDATE pg_catalog.pg_class
	SET relfrozenxid = '702'
	WHERE oid = 'test'::pg_catalog.regclass;
	
	-- For binary upgrade, set toast's relfrozenxid
	UPDATE pg_catalog.pg_class
	SET relfrozenxid = '702'
	WHERE oid = '16434';

We also preserve the pg_class oids with:

	-- For binary upgrade, must preserve pg_class oids
	SELECT binary_upgrade.set_next_heap_pg_class_oid('16431'::pg_catalog.oid);
	SELECT binary_upgrade.set_next_toast_pg_class_oid('16434'::pg_catalog.oid);
	SELECT binary_upgrade.set_next_index_pg_class_oid('16436'::pg_catalog.oid);

The question is whether this is working, and if not, why not?

-- 
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + It's impossible for everything to be true. +



view thread (61+ messages)  latest in thread

Message-ID: <201108311723.p7VHN5m16754@momjian.us>
Permalink:  ../201108311723.p7VHN5m16754@momjian.us/
Also on:    postgresql.org/message-id/201108311723.p7VHN5m16754@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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: bruce@momjian.us, depesz@depesz.com, pgsql-hackers@postgreSQL.org
  Subject: Re: [GENERAL] pg_upgrade problem
  In-Reply-To: <201108311723.p7VHN5m16754@momjian.us>
  References: <20110829174924.GA14101@depesz.com> <201108311723.p7VHN5m16754@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