Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbb4aed4

Browse files
committed
Shut down EvalPlanQual machinery when LockRows node reaches the end.
Previously, we left the EPQ sub-executor alone until ExecEndLockRows.This caused any buffer pins or other resources that it might hold toremain held until ExecutorEnd, which in some code paths means thatthey are held till the Portal is closed. That can cause user-visibleproblems, such as blocking VACUUM; and it's unlike the behavior ofordinary table-scanning nodes, which will have released all bufferpins by the time they return an EOF indication.We can make LockRows work more like other plan nodes by callingEvalPlanQualEnd just before returning NULL. We still need to call itin ExecEndLockRows in case the node was not run to completion, but inthe normal case the second call does nothing and costs little.Per report from Yura Sokolov. In principle this is a longstandingbug, but in view of the lack of other complaints and the low severityof the consequences, I chose not to back-patch.Discussion:https://postgr.es/m/4aa370cb91ecf2f9885d98b80ad1109c@postgrespro.ru
1 parent9bb5eec commitbb4aed4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

‎src/backend/executor/nodeLockRows.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,11 @@ ExecLockRows(PlanState *pstate)
5959
slot=ExecProcNode(outerPlan);
6060

6161
if (TupIsNull(slot))
62+
{
63+
/* Release any resources held by EPQ mechanism before exiting */
64+
EvalPlanQualEnd(&node->lr_epqstate);
6265
returnNULL;
66+
}
6367

6468
/* We don't need EvalPlanQual unless we get updated tuple version(s) */
6569
epq_needed= false;
@@ -381,6 +385,7 @@ ExecInitLockRows(LockRows *node, EState *estate, int eflags)
381385
void
382386
ExecEndLockRows(LockRowsState*node)
383387
{
388+
/* We may have shut down EPQ already, but no harm in another call */
384389
EvalPlanQualEnd(&node->lr_epqstate);
385390
ExecEndNode(outerPlanState(node));
386391
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp