From: | Thomas Munro <tmunro(at)postgresql(dot)org> |
---|---|
To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
Subject: | pgsql: Defer restoration of libraries in parallel workers. |
Date: | 2018-09-20 02:24:50 |
Message-ID: | E1g2oeA-00005W-1N@gemulon.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
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
------
REL9_6_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/de4fe83c7e6d14d996babec814c4fc12490889ef
Modified Files
--------------
src/backend/access/transam/parallel.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Laurenz Albe | 2018-09-20 03:51:20 | Re: pgsql: Allow concurrent-safe open() and fopen() in frontend code for Wi |
Previous Message | Thomas Munro | 2018-09-20 02:24:17 | pgsql: Defer restoration of libraries in parallel workers. |