Commit 88ef48c1 authored by Robert Haas's avatar Robert Haas

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
parent 80f021ef
...@@ -5825,7 +5825,8 @@ plan_create_index_workers(Oid tableOid, Oid indexOid) ...@@ -5825,7 +5825,8 @@ plan_create_index_workers(Oid tableOid, Oid indexOid)
double allvisfrac; double allvisfrac;
/* Return immediately when parallelism disabled */ /* 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; return 0;
/* Set up largely-dummy planner state */ /* Set up largely-dummy planner state */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment