postgres.git / summary / log / commit / refs
commit 24897e1a1af27dc759fb41afba2a663ff9af4ef6
Author: Thomas Munro <tmunro@postgresql.org>
Date: Fri Nov 15 21:04:52 2019 +0000
First released in: 13.0, 11.7, 12.2
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
src/backend/executor/execMain.c | 23 +++++++----------------
1 file changed, 7 insertions(+), 16 deletions(-)
diff --git a/src/backend/executor/execMain.c b/src/backend/executor/execMain.c
index 1438685536f..4759140e1f7 100644
--- a/src/backend/executor/execMain.c
+++ b/src/backend/executor/execMain.c
@@ -1650,15 +1650,7 @@ ExecutePlan(EState *estate,
* process so we just end the loop...
*/
if (TupIsNull(slot))
- {
- /*
- * If we know we won't need to back up, we can release resources
- * at this point.
- */
- if (!(estate->es_top_eflags & EXEC_FLAG_BACKWARD))
- (void) ExecShutdownNode(planstate);
break;
- }
/*
* If we have a junk filter, then project a new tuple with the junk
@@ -1701,17 +1693,16 @@ ExecutePlan(EState *estate,
*/
current_tuple_count++;
if (numberTuples && numberTuples == current_tuple_count)
- {
- /*
- * If we know we won't need to back up, we can release resources
- * at this point.
- */
- if (!(estate->es_top_eflags & EXEC_FLAG_BACKWARD))
- (void) ExecShutdownNode(planstate);
break;
- }
}
+ /*
+ * If we know we won't need to back up, we can release resources at this
+ * point.
+ */
+ if (!(estate->es_top_eflags & EXEC_FLAG_BACKWARD))
+ (void) ExecShutdownNode(planstate);
+
if (use_parallel_mode)
ExitParallelMode();
}
[parent: d61e7f174db9]