pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Defer restoration of libraries in parallel workers.
4+ messages / 1 participants
[nested] [flat]

* pgsql: Defer restoration of libraries in parallel workers.
@ 2018-09-20 02:23  Thomas Munro <tmunro@postgresql.org>
  0 siblings, 0 replies; 4+ messages in thread

From: Thomas Munro @ 2018-09-20 02:23 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/6c3c9d418918373a9535ad3d3bd357f652a367e3

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



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* pgsql: Defer restoration of libraries in parallel workers.
@ 2018-09-20 02:23  Thomas Munro <tmunro@postgresql.org>
  0 siblings, 0 replies; 4+ messages in thread

From: Thomas Munro @ 2018-09-20 02:23 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/9d178fb928040f1a5ab5b566f1ec76d7ac554587

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



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* pgsql: Defer restoration of libraries in parallel workers.
@ 2018-09-20 02:24  Thomas Munro <tmunro@postgresql.org>
  0 siblings, 0 replies; 4+ messages in thread

From: Thomas Munro @ 2018-09-20 02:24 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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(-)



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* pgsql: Defer restoration of libraries in parallel workers.
@ 2018-09-20 02:24  Thomas Munro <tmunro@postgresql.org>
  0 siblings, 0 replies; 4+ messages in thread

From: Thomas Munro @ 2018-09-20 02:24 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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(-)



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2018-09-20 02:24 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-09-20 02:23 pgsql: Defer restoration of libraries in parallel workers. Thomas Munro <tmunro@postgresql.org>
2018-09-20 02:23 pgsql: Defer restoration of libraries in parallel workers. Thomas Munro <tmunro@postgresql.org>
2018-09-20 02:24 pgsql: Defer restoration of libraries in parallel workers. Thomas Munro <tmunro@postgresql.org>
2018-09-20 02:24 pgsql: Defer restoration of libraries in parallel workers. Thomas Munro <tmunro@postgresql.org>

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