Fix worker_spi when launching workers without shared_preload_libraries
Michael Paquier <michael@paquier.xyz>
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
Files
| Path | Change | +/− |
|---|---|---|
| src/test/modules/worker_spi/worker_spi.c | modified | +14 −9 |
Discussion
- Support worker_spi to execute the function dynamically. 34 messages · 2023-07-20 → 2023-07-29