Re: Assert failure on running a completed portal again
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Yugo Nagata <nagata@sraoss.co.jp>, pgsql-hackers@postgresql.org
Date: 2024-12-10T16:52:34Z
Lists: pgsql-hackers
On Thu, Dec 5, 2024 at 8:09 PM Tom Lane <tgl@sss.pgh.pa.us> wrote: > After looking at this further, I think this whole "run_once" > business is badly designed, worse documented, and redundant > (as well as buggy). It can be replaced with three self-contained > lines in ExecutePlan, as per the attached. Did you look at the commit message for 691b8d59281b5177f16fe80858df921f77a8e955? IMHO, that's pretty clear about what the goals of this were. I didn't consider the scenario mentioned by Nagata-san in his original post, namely, executing a portal with a row count of 0 and then doing the same thing again. So in that sense the assertion fulfilled its intended purpose: alerting somebody that there is a case which is reachable but which the original programmer believed to be unreachable. I haven't tested, but I'm guessing that what happens in Nagata-san's case with the committed fix is that we execute the plan once to completion in parallel mode; and then the second execute message executes the same plan tree again in non-parallel mode but this time it ends up returning zero tuples because it's already been executed to completion. If that is correct, then I think this is subtly changing the rules for parallel Plan trees: before, the rule as I understood it, was "only complete execution must supported" but now it's "complete executed must be supported and, in addition, a no-op re-execution after complete execution must be supported". Off the top of my head that seems like it should be fine. -- Robert Haas EDB: http://www.enterprisedb.com
Commits
-
Doc: add some commentary about ExecutorRun's NoMovement special case.
- 982890530379 18.0 landed
-
Simplify executor's determination of whether to use parallelism.
- bb649b553c58 16.7 landed
- 8a95ad3b205c 14.16 landed
- 556f7b7bc18d 17.3 landed
- 4d20bad5e9c6 13.19 landed
- 4089b9bd6f19 15.11 landed
- 3eea7a0c97e9 18.0 landed
-
Allow for parallel execution whenever ExecutorRun() is done only once.
- 691b8d59281b 10.0 cited