diff options
author | Michael Paquier <michael@paquier.xyz> | 2023-10-05 12:22:28 +0900 |
---|---|---|
committer | Michael Paquier <michael@paquier.xyz> | 2023-10-05 12:22:28 +0900 |
commit | 4f2994647ff1e1209829a0085ca0c8d237dbbbb4 (patch) | |
tree | b0f21667480f3f713bfa225b963f6e9d23ef8571 /src/backend/utils/adt/jsonfuncs.c | |
parent | c789f0f6cc5da084f75f2556bada572a1a05e39a (diff) | |
download | postgresql-4f2994647ff1e1209829a0085ca0c8d237dbbbb4.tar.gz postgresql-4f2994647ff1e1209829a0085ca0c8d237dbbbb4.zip |
worker_spi: Expand set of options to start workers
A couple of new options are added to this module to provide more control
on the ways bgworkers are started:
- A new GUC called worker_spi.role to control which role to use by
default when starting a worker.
- worker_spi_launch() gains three arguments: a role OID, a database OID
and flags (currently only BGWORKER_BYPASS_ALLOWCONN). By default, the
role OID and the database OID are InvalidOid, in which case the worker
would use the related GUCs.
Workers loaded by shared_preload_libraries use the default values
provided by the GUCs, with flags at 0. The options are given to the
main bgworker routine through bgw_extra. A test case is tweaked to
start two dynamic workers with databases and roles defined by the caller
of worker_spi_launch().
These additions will have the advantage of expanding the tests for
bgworkers, for at least two cases:
- BGWORKER_BYPASS_ALLOWCONN has no coverage in the core tree.
- A new bgworker flag is under discussion, and this eases the
integration of new tests.
Reviewed-by: Bertrand Drouvot
Discussion: https://postgr.es/m/bcc36259-7850-4882-97ef-d6b905d2fc51@gmail.com
Diffstat (limited to 'src/backend/utils/adt/jsonfuncs.c')
0 files changed, 0 insertions, 0 deletions