aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2018-02-12 12:55:12 -0500
committerRobert Haas <rhaas@postgresql.org>2018-02-12 12:55:12 -0500
commit88ef48c1ccee6a2200e01318180cf521413b3012 (patch)
tree1f83ddcf47de36b07cc1bab85737008a8eb02bba /src
parent80f021ef139affdb219ccef71fff283e8f91f112 (diff)
downloadpostgresql-88ef48c1ccee6a2200e01318180cf521413b3012.tar.gz
postgresql-88ef48c1ccee6a2200e01318180cf521413b3012.zip
Fix parallel index builds for dynamic_shared_memory_type=none.
The previous code failed to realize that this setting effectively disables parallelism, and would crash if it decided to attempt parallelism anyway. Instead, treat it as a disabling condition. Kyotaro Horiguchi, who also reported the issue. Reviewed by Michael Paquier and Peter Geoghegan. Discussion: http://postgr.es/m/20180209.170635.256350357.horiguchi.kyotaro@lab.ntt.co.jp
Diffstat (limited to 'src')
-rw-r--r--src/backend/optimizer/plan/planner.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/backend/optimizer/plan/planner.c b/src/backend/optimizer/plan/planner.c
index 740de4957dd..3e8cd1447cc 100644
--- a/src/backend/optimizer/plan/planner.c
+++ b/src/backend/optimizer/plan/planner.c
@@ -5825,7 +5825,8 @@ plan_create_index_workers(Oid tableOid, Oid indexOid)
double allvisfrac;
/* Return immediately when parallelism disabled */
- if (max_parallel_maintenance_workers == 0)
+ if (dynamic_shared_memory_type == DSM_IMPL_NONE ||
+ max_parallel_maintenance_workers == 0)
return 0;
/* Set up largely-dummy planner state */