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

Commitfac31b2

Browse files
committed
Prevent parallel index build in a standalone backend.
This can't work if there's no postmaster, and indeed the code got anassertion failure trying. There should be a check on IsUnderPostmastergating the use of parallelism, as the planner has for ordinaryparallel queries.Commit40d964e got this right, so follow its model of checkingIsUnderPostmaster at the same place where we check formax_parallel_maintenance_workers == 0. In general, new codeimplementing parallel utility operations should do the same.Report and patch by Yulin Pei, cosmetically adjusted by me.Back-patch to v11 where this code came in.Discussion:https://postgr.es/m/HK0PR01MB22747D839F77142D7E76A45DF4F50@HK0PR01MB2274.apcprd01.prod.exchangelabs.com
1 parent666a4de commitfac31b2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

‎src/backend/optimizer/plan/planner.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6360,8 +6360,11 @@ plan_create_index_workers(Oid tableOid, Oid indexOid)
63606360
doublereltuples;
63616361
doubleallvisfrac;
63626362

6363-
/* Return immediately when parallelism disabled */
6364-
if (max_parallel_maintenance_workers==0)
6363+
/*
6364+
* We don't allow performing parallel operation in standalone backend or
6365+
* when parallelism is disabled.
6366+
*/
6367+
if (!IsUnderPostmaster||max_parallel_maintenance_workers==0)
63656368
return0;
63666369

63676370
/* Set up largely-dummy planner state */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp