Re: a modest improvement to get_object_address() - Mailing list pgsql-hackers

From Robert Haas
Subject Re: a modest improvement to get_object_address()
Date
Msg-id CA+TgmoaTchWYuTFR7oJkN60bFTxu8BzXUpiWNsrhCR12=f9mGA@mail.gmail.com
Whole thread Raw
In response to Re: a modest improvement to get_object_address()  (Dimitri Fontaine <dimitri@2ndQuadrant.fr>)
List pgsql-hackers
On Wed, Nov 9, 2011 at 3:40 PM, Dimitri Fontaine <dimitri@2ndquadrant.fr> wrote:
> Back to the problem you raised, it's DDL and we're sitting in between
> SnapshotNow and catalog cache entries.  Not so comfy.  I would guess
> that the problem (I confess didn't read carefully enough) happens after
> having done a cache lookup when trying to use its result?

There's a test case in the original post, but yes, the problem happens
when something changes between the time you do the catcache lookup and
the time you acquire the lock.  This is not a new problem; I'm just
trying to give a more intelligible error message - and avoid
unnecessary failures, as in the case where two concurrent DROP IF
EXISTS operations target the same object and one of them unnecessarily
rolls back.

> Could we check the object still exists as part of the cache lookup, or
> would that mean we don't have a cache anymore?  Or is the answer related
> to consuming invalidation messages before returning a stale entry from
> the cache?

All of that is way beyond the scope of what I'm doing here.

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


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: const correctness
Next
From: Dimitri Fontaine
Date:
Subject: Re: Syntax for partitioning