pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Harden xxx_is_visible() functions against concurrent object drop
Date: Sat, 14 Oct 2023 20:13:18 +0000
Message-ID: <E1qrl0f-000ZFJ-Pj@gemulon.postgresql.org> (raw)

Harden xxx_is_visible() functions against concurrent object drops.

For the same reasons given in commit 403ac226d, adjust these
functions to not assume that checking SearchSysCacheExists can
guarantee success of a later fetch.

This follows the same internal API choices made in the earlier commit:
add a function XXXExt(oid, is_missing) and use that to eliminate
the need for a separate existence check.  The changes are very
straightforward, though tedious.  For the moment I just made the new
functions static in namespace.c, but we could export them if a need
emerges.

Per bug #18014 from Alexander Lakhin.  Given the lack of hard evidence
that there's a bug in non-debug builds, I'm content to fix this only
in HEAD.

Discussion: https://postgr.es/m/18014-28c81cb79d44295d@postgresql.org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/fcdd6689d09c3950efa8a79db872f507069adb92

Modified Files
--------------
src/backend/catalog/namespace.c | 387 +++++++++++++++++++++++++++++++++++-----
src/include/catalog/namespace.h |   2 +-
2 files changed, 343 insertions(+), 46 deletions(-)



Message-ID: <E1qrl0f-000ZFJ-Pj@gemulon.postgresql.org>
Permalink:  ../E1qrl0f-000ZFJ-Pj@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1qrl0f-000ZFJ-Pj@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Harden xxx_is_visible() functions against concurrent object drop
  In-Reply-To: <E1qrl0f-000ZFJ-Pj@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox