Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9f67dd1

Browse files
michaelpqpull[bot]
authored andcommitted
Fix worker_spi when launching workers without shared_preload_libraries
Currently, the database name to connect is initialized only when themodule is loaded with shared_preload_libraries, causing any call ofworker_spi_launch() to fail if the library is not loaded for a dynamicbgworker launch. Rather than making the GUC defining the database toconnect to a PGC_POSTMASTER, this commit switches worker_spi.database toPGC_SIGHUP, loaded even if the module's library is loaded dynamicallyfor a worker.We have been discussing about the integration of more advanced tests inthis module, with and without shared_preload_libraries set, so thiseases a bit the work planned in this area.No backpatch is done as, while this is a bug, it changes the definitionof worker_spi.database.Author: Masahiro IkedaReviewed-by: Bharath RupireddyDiscussion:https://postgr.es/m/d30d3ea7d21cb7c9e1e3cc47e301f1b6@oss.nttdata.com
1 parentb680146 commit9f67dd1

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

‎src/test/modules/worker_spi/worker_spi.c

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,11 @@ _PG_init(void)
283283
BackgroundWorkerworker;
284284

285285
/* get the configuration */
286+
287+
/*
288+
* These GUCs are defined even if this library is not loaded with
289+
* shared_preload_libraries, for worker_spi_launch().
290+
*/
286291
DefineCustomIntVariable("worker_spi.naptime",
287292
"Duration between each check (in seconds).",
288293
NULL,
@@ -296,6 +301,15 @@ _PG_init(void)
296301
NULL,
297302
NULL);
298303

304+
DefineCustomStringVariable("worker_spi.database",
305+
"Database to connect to.",
306+
NULL,
307+
&worker_spi_database,
308+
"postgres",
309+
PGC_SIGHUP,
310+
0,
311+
NULL,NULL,NULL);
312+
299313
if (!process_shared_preload_libraries_in_progress)
300314
return;
301315

@@ -312,15 +326,6 @@ _PG_init(void)
312326
NULL,
313327
NULL);
314328

315-
DefineCustomStringVariable("worker_spi.database",
316-
"Database to connect to.",
317-
NULL,
318-
&worker_spi_database,
319-
"postgres",
320-
PGC_POSTMASTER,
321-
0,
322-
NULL,NULL,NULL);
323-
324329
MarkGUCPrefixReserved("worker_spi");
325330

326331
/* set up common data for all our workers */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp