postgresql/src/backend/access
Thomas Munro 6c3c9d4189 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
2018-09-20 14:21:18 +12:00
..
brin Fail BRIN control functions during recovery explicitly 2018-06-14 12:51:32 -04:00
common Deduplicate code between slot_getallattrs() and slot_getsomeattrs(). 2018-08-23 16:58:53 -07:00
gin Fix past pd_upper write in ginRedoRecompress() 2018-09-09 21:19:29 +03:00
gist Add support for nearest-neighbor (KNN) searches to SP-GiST 2018-09-19 01:54:10 +03:00
hash During the split, set checksum on an empty hash index page. 2018-09-04 08:35:42 +05:30
heap Avoid using potentially-under-aligned page buffers. 2018-09-01 15:27:17 -04:00
index Add support for nearest-neighbor (KNN) searches to SP-GiST 2018-09-19 01:54:10 +03:00
nbtree Reduce path length for locking leaf B-tree pages during insertion 2018-07-28 00:31:40 +03:00
rmgrdesc printf("%lf") is not portable, so omit the "l". 2018-05-20 11:40:54 -04:00
spgist Add support for nearest-neighbor (KNN) searches to SP-GiST 2018-09-19 01:54:10 +03:00
tablesample Rethink how to get float.h in old Windows API for isnan/isinf 2018-07-11 09:11:48 -04:00
transam Defer restoration of libraries in parallel workers. 2018-09-20 14:21:18 +12:00
Makefile TABLESAMPLE, SQL Standard and extensible 2015-05-15 14:37:10 -04:00