pgsql: Prevent parallel index build in a standalone backend. - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Prevent parallel index build in a standalone backend.
Date
Msg-id E1kjp02-0004en-NO@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Prevent parallel index build in a standalone backend.

This can't work if there's no postmaster, and indeed the code got an
assertion failure trying.  There should be a check on IsUnderPostmaster
gating the use of parallelism, as the planner has for ordinary
parallel queries.

Commit 40d964ec9 got this right, so follow its model of checking
IsUnderPostmaster at the same place where we check for
max_parallel_maintenance_workers == 0.  In general, new code
implementing 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

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/16a1e1ea4fa323d5fc34883cbb2f61eccae8d45f

Modified Files
--------------
src/backend/optimizer/plan/planner.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Fix miscomputation of direct_lateral_relids for join relations.
Next
From: Tom Lane
Date:
Subject: pgsql: Remove configure-time probe for DocBook DTD.