pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Prevent parallel index build in a standalone backend. 4+ messages / 1 participants [nested] [flat]
* pgsql: Prevent parallel index build in a standalone backend. @ 2020-11-30 19:38 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 4+ messages in thread From: Tom Lane @ 2020-11-30 19:38 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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.... Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/275b3411d9189b3974687766db06727d64d22979 Modified Files -------------- src/backend/optimizer/plan/planner.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 4+ messages in thread
* pgsql: Prevent parallel index build in a standalone backend. @ 2020-11-30 19:38 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 4+ messages in thread From: Tom Lane @ 2020-11-30 19:38 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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.... 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(-) ^ permalink raw reply [nested|flat] 4+ messages in thread
* pgsql: Prevent parallel index build in a standalone backend. @ 2020-11-30 19:38 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 4+ messages in thread From: Tom Lane @ 2020-11-30 19:38 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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.... Branch ------ REL_13_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/fac31b2cd4470124d7d68a7eebdb13cfff8b3d3d Modified Files -------------- src/backend/optimizer/plan/planner.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 4+ messages in thread
* pgsql: Prevent parallel index build in a standalone backend. @ 2020-11-30 19:38 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 4+ messages in thread From: Tom Lane @ 2020-11-30 19:38 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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.... Branch ------ REL_11_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/942e441ee8f444bcc877ee7cdae00d5ecd312feb Modified Files -------------- src/backend/optimizer/plan/planner.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2020-11-30 19:38 UTC | newest] Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2020-11-30 19:38 pgsql: Prevent parallel index build in a standalone backend. Tom Lane <tgl@sss.pgh.pa.us> 2020-11-30 19:38 pgsql: Prevent parallel index build in a standalone backend. Tom Lane <tgl@sss.pgh.pa.us> 2020-11-30 19:38 pgsql: Prevent parallel index build in a standalone backend. Tom Lane <tgl@sss.pgh.pa.us> 2020-11-30 19:38 pgsql: Prevent parallel index build in a standalone backend. Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox