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@postgresql.org
Subject: pgsql: Replace over-optimistic Assert in partitioning code with a runti
Date: Sun, 04 Jun 2017 20:21:02 +0000
Message-ID: <E1dHc1G-00043z-90@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

Replace over-optimistic Assert in partitioning code with a runtime test.

get_partition_parent felt that it could simply Assert that systable_getnext
found a tuple.  This is unlike any other caller of that function, and it's
unsafe IMO --- in fact, the reason I noticed it was that the Assert failed.
(OK, I was working with known-inconsistent catalog contents, but I wasn't
expecting the DB to fall over quite that violently.  The behavior in a
non-assert-enabled build wouldn't be very nice, either.)  Fix it to do what
other callers do, namely an actual runtime-test-and-elog.

Also, standardize the wording of elog messages that are complaining about
unexpected failure of systable_getnext.  90% of them say "could not find
tuple for <object>", so make the remainder do likewise.  Many of the
holdouts were using the phrasing "cache lookup failed", which is outright
misleading since no catcache search is involved.

Branch
------
master

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

Modified Files
--------------
contrib/sepgsql/database.c          | 2 +-
contrib/sepgsql/proc.c              | 4 ++--
contrib/sepgsql/relation.c          | 8 ++++----
contrib/sepgsql/schema.c            | 2 +-
src/backend/catalog/aclchk.c        | 4 ++--
src/backend/catalog/objectaddress.c | 2 +-
src/backend/catalog/partition.c     | 3 ++-
src/backend/commands/extension.c    | 9 +++++----
src/backend/utils/adt/ruleutils.c   | 2 +-
9 files changed, 19 insertions(+), 17 deletions(-)


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


Message-ID: <E1dHc1G-00043z-90@gemulon.postgresql.org>
Permalink:  ../E1dHc1G-00043z-90@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1dHc1G-00043z-90@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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Replace over-optimistic Assert in partitioning code with a runti
  In-Reply-To: <E1dHc1G-00043z-90@gemulon.postgresql.org>
  References: <E1dHc1G-00043z-90@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