pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Thomas Munro <tmunro@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Defer restoration of libraries in parallel workers.
Date: Thu, 20 Sep 2018 02:24:17 +0000
Message-ID: <E1g2odd-000050-8K@gemulon.postgresql.org> (raw)

Defer restoration of libraries in parallel workers.

Several users of extensions complained of crashes in parallel workers
that turned out to be due to syscache access from their _PG_init()
functions.  Reorder the initialization of parallel workers so that
libraries are restored after the caches are initialized, and inside a
transaction.

This was reported in bug #15350 and elsewhere.  We don't consider it
to be a bug: extensions shouldn't do that, because then they can't be
used in shared_preload_libraries.  However, it's a fairly obscure
hazard and these extensions worked in practice before parallel query
came along.  So let's make it work.  Later commits might add a warning
message and eventually an error.

Back-patch to 9.6, where parallel query landed.

Author: Thomas Munro
Reviewed-by: Amit Kapila
Reported-by: Kieran McCusker, Jimmy
Discussion: https://postgr.es/m/153512195228.1489.8545997741965926448%40wrigleys.postgresql.org

Branch
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/98a4e814e473784716f889d8e67d66c38e94c6b0

Modified Files
--------------
src/backend/access/transam/parallel.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)



view thread (4+ messages)  latest in thread

Message-ID: <E1g2odd-000050-8K@gemulon.postgresql.org>
Permalink:  ../E1g2odd-000050-8K@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1g2odd-000050-8K@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: tmunro@postgresql.org
  Subject: Re: pgsql: Defer restoration of libraries in parallel workers.
  In-Reply-To: <E1g2odd-000050-8K@gemulon.postgresql.org>
  References: <E1g2odd-000050-8K@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