Re: Re: [GENERAL] pg_upgrade fails, "mismatch of relation OID" - 9.1.9 to 9.2.4

From: "Evan D(dot) Hoffman" <evandhoffman(at)gmail(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Igor Neyman <ineyman(at)perceptron(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: [GENERAL] pg_upgrade fails, "mismatch of relation OID" - 9.1.9 to 9.2.4
Date: 2013-05-09 21:41:39
Message-ID: 9C3927A4-E3D2-4393-9678-8A9583009129@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

I believe the history of this cluster is that it started on 9.0 and was upgraded to 9.1 via pg_upgrade. The instance I'm working on was created as a streaming replica, then I broke the replication to make it a standalone master specifically for testing pg_upgrade to 9.2.

On May 9, 2013, at 5:29 PM, Bruce Momjian <bruce(at)momjian(dot)us> wrote:

> On Thu, May 9, 2013 at 05:11:43PM -0400, Tom Lane wrote:
>> Bruce Momjian <bruce(at)momjian(dot)us> writes:
>>> OK, that's progress. Having received the table schema privately via
>>> email, I see several 'character varying(40)' fields in the schema. So
>>> the question is how was this table able to get away without a TOAST
>>> table in 9.1, while 9.2 created one for an empty table? Ideas?
>>
>> AFAICT the needs_toast_table() logic is identical between 9.1 and 9.2,
>> so it seems like it must have something to do with an odd ALTER TABLE
>> history in the source database. It's hard to think what, however.
>>
>> In any case, it seems like pg_upgrade ought to have a strategy for
>> dealing with tables acquiring toast tables like this, since if we
>> ever do tweak the needs_toast_table() logic, or for instance do
>> something like deciding to support 6-byte UTF8 codes, we're going
>> to face such cases. I dunno exactly how we might deal with it though...
>
> Well, pg_upgrade operates in super-paranoid mode, so if we relax this,
> it could potentially allow silent upgrade failures. I realize
> eventually we will need to deal with this, but I would prefer to delay
> that.
>
> Also, I added code in PG 9.1 to allow the old/new clusters to have
> identical OID layouts, so this would certainly complicate the code; see
> info.c::gen_db_file_maps() for the check that is failing, and you can
> see the 1:1 relationship. It was done in this commit:
>
> commit 002c105a0706bd1c1e939fe0f47ecdceeae6c52d
> Author: Bruce Momjian <bruce(at)momjian(dot)us>
> Date: Sat Jan 8 13:44:44 2011 -0500
>
> In pg_upgrade, remove functions that did sequential array scans looking
> up relations, but rather order old/new relations and use the same array
> index value for both. This should speed up pg_upgrade for databases
> with many relations.
>
> FYI, historically we have fixed TOAST table creation issues in pg_dump.
>
> Evan, is the 9.1 cluster loaded into 9.1 or did you use pg_upgrade
> previously to upgrade it _to_ 9.1?
>
> --
> Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
> EnterpriseDB http://enterprisedb.com
>
> + It's impossible for everything to be true. +

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Larry Rosenman 2013-05-09 21:43:10 Re: LONG delete with LOTS of FK's
Previous Message Tom Lane 2013-05-09 21:40:49 Re: LONG delete with LOTS of FK's

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2013-05-09 21:45:15 Re: corrupt pages detected by enabling checksums
Previous Message Tom Lane 2013-05-09 21:39:15 Re: corrupt pages detected by enabling checksums