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

Commit3fa5d08

Browse files
committed
Forbid to spawn partitions using bgw from bgw spawning partitions.
1 parentdbcbd02 commit3fa5d08

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

‎src/pathman_workers.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ static const char *spawn_partitions_bgw= "SpawnPartitionsWorker";
8484
staticconstchar*concurrent_part_bgw="ConcurrentPartWorker";
8585

8686

87+
/* Used for preventing spawn bgw recursion trouble */
88+
staticboolam_spawn_bgw= false;
89+
8790
/*
8891
* Estimate amount of shmem needed for concurrent partitioning.
8992
*/
@@ -312,6 +315,11 @@ create_partitions_for_value_bg_worker(Oid relid, Datum value, Oid value_type)
312315
SpawnPartitionArgs*bgw_args;
313316
Oidchild_oid=InvalidOid;
314317

318+
if (am_spawn_bgw)
319+
ereport(ERROR,
320+
(errmsg("Attempt to spawn partition using bgw from bgw spawning partitions"),
321+
errhint("Probably init_callback has INSERT to its table?")));
322+
315323
/* Create a dsm segment for the worker to pass arguments */
316324
segment=create_partitions_bg_worker_segment(relid,value,value_type);
317325
segment_handle=dsm_segment_handle(segment);
@@ -363,6 +371,8 @@ bgw_main_spawn_partitions(Datum main_arg)
363371
/* We're now ready to receive signals */
364372
BackgroundWorkerUnblockSignals();
365373

374+
am_spawn_bgw= true;
375+
366376
/* Create resource owner */
367377
CurrentResourceOwner=ResourceOwnerCreate(NULL,spawn_partitions_bgw);
368378

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp