From bfc78d7196eb28cd4e3d6c24f7e607bacecf1129 Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Fri, 16 Oct 2015 11:56:02 -0400 Subject: Rewrite interaction of parallel mode with parallel executor support. In the previous coding, before returning from ExecutorRun, we'd shut down all parallel workers. This was dead wrong if ExecutorRun was called with a non-zero tuple count; it had the effect of truncating the query output. To fix, give ExecutePlan control over whether to enter parallel mode, and have it refuse to do so if the tuple count is non-zero. Rewrite the Gather logic so that it can cope with being called outside parallel mode. Commit 7aea8e4f2daa4b39ca9d1309a0c4aadb0f7ed81b is largely to blame for this problem, though this patch modifies some subsequently-committed code which relied on the guarantees it purported to make. --- src/include/executor/execParallel.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/include/executor/execParallel.h') diff --git a/src/include/executor/execParallel.h b/src/include/executor/execParallel.h index 4fc797ad982..505500e76b5 100644 --- a/src/include/executor/execParallel.h +++ b/src/include/executor/execParallel.h @@ -32,5 +32,6 @@ typedef struct ParallelExecutorInfo extern ParallelExecutorInfo *ExecInitParallelPlan(PlanState *planstate, EState *estate, int nworkers); extern void ExecParallelFinish(ParallelExecutorInfo *pei); +extern void ExecParallelCleanup(ParallelExecutorInfo *pei); #endif /* EXECPARALLEL_H */ -- cgit v1.2.3