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

Appearance settings

Commit 76cbfcd

Browse filesBrowse files
committed
Always call ExecShutdownNode() if appropriate.
Call ExecShutdownNode() after ExecutePlan()'s loop, rather than at each break. We had forgotten to do that in one case. The omission caused intermittent "temporary file leak" warnings from multi-batch parallel hash joins with a LIMIT clause. Back-patch to 11. Though the problem exists in theory in earlier parallel query releases, nothing really depended on it. Author: Kyotaro Horiguchi Reviewed-by: Thomas Munro, Amit Kapila Discussion: https://postgr.es/m/20191111.212418.2222262873417235945.horikyota.ntt%40gmail.com
1 parent 6ae4d27 commit 76cbfcd
Copy full SHA for 76cbfcd

File tree

Expand file treeCollapse file tree

1 file changed

+7
-16
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-16
lines changed

‎src/backend/executor/execMain.c

Copy file name to clipboardExpand all lines: src/backend/executor/execMain.c
+7-16Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1650,15 +1650,7 @@ ExecutePlan(EState *estate,
16501650
* process so we just end the loop...
16511651
*/
16521652
if (TupIsNull(slot))
1653-
{
1654-
/*
1655-
* If we know we won't need to back up, we can release resources
1656-
* at this point.
1657-
*/
1658-
if (!(estate->es_top_eflags & EXEC_FLAG_BACKWARD))
1659-
(void) ExecShutdownNode(planstate);
16601653
break;
1661-
}
16621654

16631655
/*
16641656
* If we have a junk filter, then project a new tuple with the junk
@@ -1701,17 +1693,16 @@ ExecutePlan(EState *estate,
17011693
*/
17021694
current_tuple_count++;
17031695
if (numberTuples && numberTuples == current_tuple_count)
1704-
{
1705-
/*
1706-
* If we know we won't need to back up, we can release resources
1707-
* at this point.
1708-
*/
1709-
if (!(estate->es_top_eflags & EXEC_FLAG_BACKWARD))
1710-
(void) ExecShutdownNode(planstate);
17111696
break;
1712-
}
17131697
}
17141698

1699+
/*
1700+
* If we know we won't need to back up, we can release resources at this
1701+
* point.
1702+
*/
1703+
if (!(estate->es_top_eflags & EXEC_FLAG_BACKWARD))
1704+
(void) ExecShutdownNode(planstate);
1705+
17151706
if (use_parallel_mode)
17161707
ExitParallelMode();
17171708
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.