Re: Something is rotten in the state of Denmark...

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Something is rotten in the state of Denmark...
Date: 2015-04-02 20:02:24
Message-ID: CA+TgmoZPQD6twqceh1romC1qvMvmVpeLZ2T_5yHZCsJuBWeBdg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Apr 2, 2015 at 3:59 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
>> On Thu, Apr 2, 2015 at 2:55 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>>> Actually, now that I think it through, the "could not open relation"
>>> error is pretty odd in itself. If we are trying to open pg_am using
>>> a stale catalog snapshot, it seems like we ought to reliably find its
>>> old pg_class tuple (the one with the obsolete relfilenode), rather than
>>> finding nothing. But the latter is the behavior I'm seeing.
>
>> What's to stop the old tuple from being HOT-pruned?
>
> Hm, that may be it. I went back to the previous test scenario, and now
> I can *only* get the "cache lookup failed for access method" behavior,
> instead of what I was getting before, so I'm getting a bit confused :-(.
> However, it does seem clear that the mechanism is indeed that we're
> relying on an obsolete copy of pg_am's pg_class tuple, hence scanning a
> truncated relfilenode, and that the patch I proposed fixes it.
>
> Perhaps the difference has to do with whether pg_am's pg_class tuple is
> on a page that hasn't got enough room for a HOT update? But I definitely
> tried it several times and consistently got the same failure before.

That seems plausible, except that I have no idea why that would vary
from one test setup to another. I suggest pushing the patch you
proposed upthread and seeing what the buildfarm thinks.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2015-04-02 20:11:37 Re: Something is rotten in the state of Denmark...
Previous Message Tom Lane 2015-04-02 19:59:53 Re: Something is rotten in the state of Denmark...