Re: Assert failure on running a completed portal again
Yugo Nagata <nagata@sraoss.co.jp>
From: Yugo NAGATA <nagata@sraoss.co.jp>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@postgresql.org
Date: 2024-12-09T07:20:28Z
Lists: pgsql-hackers
On Sun, 08 Dec 2024 14:25:53 -0500
Tom Lane <tgl@sss.pgh.pa.us> wrote:
> I 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.
>
> > (Obviously, the API changes in this wouldn't do for the back
> > branches. But we could leave those arguments in place as
> > unused dummies.)
>
> Here's a cut-down version that I think would be OK to use in the
> back branches.
I confirmed both versions of the pach fixed the issue using pgproto.
Also, I feel your fix makes the codes easier to understand at least for me.
I have a few minor comment:
* moving in the specified direction.
*
* Runs to completion if numberTuples is 0
- *
- * Note: the ctid attribute is a 'junk' attribute that is removed before the
- * user can see it
* ----------------------------------------------------------------
*/
This comment remove seems not related to the fix of ExecutePlan. Should this
actually have been done by 8a5849b7ff24c?
static void
-ExecutePlan(EState *estate,
- PlanState *planstate,
+ExecutePlan(QueryDesc *queryDesc,
bool use_parallel_mode,
CmdType operation,
bool sendTuples,
uint64 numberTuples,
ScanDirection direction,
- DestReceiver *dest,
- bool execute_once)
+ DestReceiver *dest)
{
+ EState *estate = queryDesc->estate;
+ PlanState *planstate = queryDesc->planstate;
TupleTableSlot *slot;
uint64 current_tuple_count
I guess planstate is removed due to the redundancy that this is included
in queryDesc. If so, I think we can also remove use_parallel_mode for the
same reason.
Regards,
Yugo Nagata
--
Yugo NAGATA <nagata@sraoss.co.jp>
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