pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Geoghegan <pg@bowt.ie>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add table relcache invalidation to index builds.
Date: Fri, 03 Aug 2018 22:16:34 +0000
Message-ID: <E1fliN8-0002BI-NW@gemulon.postgresql.org> (raw)

Add table relcache invalidation to index builds.

It's necessary to make sure that owning tables have a relcache
invalidation prior to advancing the command counter to make
newly-entered catalog tuples for the index visible.  inval.c must be
able to maintain the consistency of the local caches in the event of
transaction abort.  There is usually only a problem when CREATE INDEX
transactions abort, since there is a generic invalidation once we reach
index_update_stats().

This bug is of long standing.  Problems were made much more likely by
the addition of parallel CREATE INDEX (commit 9da0cc35284), but it is
strongly suspected that similar problems can be triggered without
involving plan_create_index_workers().  (plan_create_index_workers()
triggers a relcache build or rebuild, which previously only happened in
rare edge cases.)

Author: Peter Geoghegan
Reported-By: Luca Ferrari
Diagnosed-By: Andres Freund
Reviewed-By: Andres Freund
Discussion: https://postgr.es/m/CAKoxK+5fVodiCtMsXKV_1YAKXbzwSfp7DgDqUmcUAzeAhf=HEQ@mail.gmail.com
Backpatch: 9.3-

Branch
------
REL9_3_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/0229e087df2ac050f53140fd7497d0e70943d16f

Modified Files
--------------
src/backend/catalog/index.c | 6 ++++++
1 file changed, 6 insertions(+)



view thread (7+ messages)

Message-ID: <E1fliN8-0002BI-NW@gemulon.postgresql.org>
Permalink:  ../E1fliN8-0002BI-NW@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1fliN8-0002BI-NW@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: pg@bowt.ie
  Subject: Re: pgsql: Add table relcache invalidation to index builds.
  In-Reply-To: <E1fliN8-0002BI-NW@gemulon.postgresql.org>
  References: <E1fliN8-0002BI-NW@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