Skip site navigation (1) Skip section navigation (2)

Re: [GENERAL] pg_upgrade problem

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: depesz(at)depesz(dot)com
Cc: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: [GENERAL] pg_upgrade problem
Date: 2011-08-31 17:23:05
Message-ID: 201108311723.p7VHN5m16754@momjian.us (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-hackers
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(at)momjian(dot)us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

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

In response to

Responses

pgsql-hackers by date

Next:From: Bruce MomjianDate: 2011-08-31 17:24:05
Subject: Re: [GENERAL] pg_upgrade problem
Previous:From: hubert depesz lubaczewskiDate: 2011-08-31 17:03:22
Subject: Re: [GENERAL] pg_upgrade problem

pgsql-general by date

Next:From: Bruce MomjianDate: 2011-08-31 17:24:05
Subject: Re: [GENERAL] pg_upgrade problem
Previous:From: Scott RibeDate: 2011-08-31 17:09:54
Subject: Re: out of memory - no sort

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group