pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix worker_spi when launching workers without shared_preload_lib
Date: Fri, 21 Jul 2023 03:08:25 +0000
Message-ID: <E1qMgVE-000Xxf-1U@gemulon.postgresql.org> (raw)

Fix worker_spi when launching workers without shared_preload_libraries

Currently, the database name to connect is initialized only when the
module is loaded with shared_preload_libraries, causing any call of
worker_spi_launch() to fail if the library is not loaded for a dynamic
bgworker launch.  Rather than making the GUC defining the database to
connect to a PGC_POSTMASTER, this commit switches worker_spi.database to
PGC_SIGHUP, loaded even if the module's library is loaded dynamically
for a worker.

We have been discussing about the integration of more advanced tests in
this module, with and without shared_preload_libraries set, so this
eases a bit the work planned in this area.

No backpatch is done as, while this is a bug, it changes the definition
of worker_spi.database.

Author: Masahiro Ikeda
Reviewed-by: Bharath Rupireddy
Discussion: https://postgr.es/m/d30d3ea7d21cb7c9e1e3cc47e301f1b6@oss.nttdata.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/97ff8dd02ca788020021cdafb85d77d4fd3f3125

Modified Files
--------------
src/test/modules/worker_spi/worker_spi.c | 23 ++++++++++++++---------
1 file changed, 14 insertions(+), 9 deletions(-)



Message-ID: <E1qMgVE-000Xxf-1U@gemulon.postgresql.org>
Permalink:  ../E1qMgVE-000Xxf-1U@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1qMgVE-000Xxf-1U@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 using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Fix worker_spi when launching workers without shared_preload_lib
  In-Reply-To: <E1qMgVE-000Xxf-1U@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