Commit a14a070
committed
Fix assertion failure with incorrect number of workers
In 18~ (581df2148737), the previous code causes an assertion failure in
the planner regarding the fact that a gather node should always have at
least 1 worker to spawn, but we were initializing this number to 0 in
pg_hint_plan when recalculating the number of workers to use for an
AppendPath. So pg_hint_plan is wrong, and upstream is right, because a
gather node should always ask for at least 1 parallel worker.
Some tests of in ut-W are impacted here because this causes an increase
in the number of workers to spawn, based on what
max_parallel_workers_per_gather is set to.
Note for v17 and older branches: this change has been originally applied
as of 3c2e9c5, and has been backpatched to all the stable branches
following issue #218, that reported that the same assertion failure can
be reached, messing with the state of Gather node paths in the backend
with an incorrect worker number compilation.
Author: William Zhang, Michael Paquier
Batchpatch-through: 13
Per issues #93 and #218.1 parent 41e74f6 commit a14a070
2 files changed
+11
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1224 | 1224 | | |
1225 | 1225 | | |
1226 | 1226 | | |
1227 | | - | |
| 1227 | + | |
1228 | 1228 | | |
1229 | 1229 | | |
1230 | 1230 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4832 | 4832 | | |
4833 | 4833 | | |
4834 | 4834 | | |
4835 | | - | |
4836 | | - | |
4837 | | - | |
| 4835 | + | |
| 4836 | + | |
| 4837 | + | |
| 4838 | + | |
4838 | 4839 | | |
4839 | | - | |
| 4840 | + | |
4840 | 4841 | | |
4841 | 4842 | | |
| 4843 | + | |
| 4844 | + | |
| 4845 | + | |
4842 | 4846 | | |
4843 | 4847 | | |
4844 | 4848 | | |
| |||
4848 | 4852 | | |
4849 | 4853 | | |
4850 | 4854 | | |
4851 | | - | |
| 4855 | + | |
| 4856 | + | |
4852 | 4857 | | |
4853 | 4858 | | |
4854 | 4859 | | |
| |||
0 commit comments