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

Commitfd4d93d

Browse files
committed
worker_spi: Fix test failure with BGWORKER_BYPASS_ALLOWCONN
A bgworker can spawn parallel workers of its own when executing queries,and if the worker uses BGWORKER_BYPASS_ALLOWCONN while the database itis connected to does not allow connections, a parallel worker would failto startup. In the case of this module, the step checking for thepresence of the schema to create was spawning a worker, failing the lasttest introduced by991bb0f.This issue could be reproduced with debug_parallel_query = 'regress',for example.Per buildfarm member crake.
1 parent991bb0f commitfd4d93d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,15 @@ worker_spi_main(Datum main_arg)
173173
BackgroundWorkerInitializeConnection(worker_spi_database,
174174
worker_spi_role,flags);
175175

176+
/*
177+
* Disable parallel query for workers started with BYPASS_ALLOWCONN so as
178+
* these don't attempt connections to the database that may not allow
179+
* that.
180+
*/
181+
if (flags&BGWORKER_BYPASS_ALLOWCONN)
182+
SetConfigOption("max_parallel_workers_per_gather","0",
183+
PGC_USERSET,PGC_S_OVERRIDE);
184+
176185
elog(LOG,"%s initialized with %s.%s",
177186
MyBgworkerEntry->bgw_name,table->schema,table->name);
178187
initialize_worker_spi(table);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp