Re: a modest improvement to get_object_address()

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Dimitri Fontaine <dimitri(at)2ndquadrant(dot)fr>
Cc: Cédric Villemain <cedric(dot)villemain(dot)debian(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: a modest improvement to get_object_address()
Date: 2011-11-09 21:04:37
Message-ID: CA+TgmoaTchWYuTFR7oJkN60bFTxu8BzXUpiWNsrhCR12=f9mGA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Nov 9, 2011 at 3:40 PM, Dimitri Fontaine <dimitri(at)2ndquadrant(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Dimitri Fontaine 2011-11-09 21:05:34 Re: Syntax for partitioning
Previous Message Robert Haas 2011-11-09 21:01:55 Re: const correctness