From 7c944bd903392829608a9fba5b0e68c4fe89abf8 Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Sun, 7 Feb 2016 11:39:22 -0500 Subject: Introduce a new GUC force_parallel_mode for testing purposes. When force_parallel_mode = true, we enable the parallel mode restrictions for all queries for which this is believed to be safe. For the subset of those queries believed to be safe to run entirely within a worker, we spin up a worker and run the query there instead of running it in the original process. When force_parallel_mode = regress, make additional changes to allow the regression tests to run cleanly even though parallel workers have been injected under the hood. Taken together, this facilitates both better user testing and better regression testing of the parallelism code. Robert Haas, with help from Amit Kapila and Rushabh Lathia. --- src/backend/access/transam/parallel.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/backend/access/transam/parallel.c') diff --git a/src/backend/access/transam/parallel.c b/src/backend/access/transam/parallel.c index bf2e691f577..4f91cd0265d 100644 --- a/src/backend/access/transam/parallel.c +++ b/src/backend/access/transam/parallel.c @@ -22,6 +22,7 @@ #include "libpq/pqformat.h" #include "libpq/pqmq.h" #include "miscadmin.h" +#include "optimizer/planmain.h" #include "storage/ipc.h" #include "storage/sinval.h" #include "storage/spin.h" @@ -1079,7 +1080,8 @@ ParallelExtensionTrampoline(dsm_segment *seg, shm_toc *toc) static void ParallelErrorContext(void *arg) { - errcontext("parallel worker, PID %d", *(int32 *) arg); + if (force_parallel_mode != FORCE_PARALLEL_REGRESS) + errcontext("parallel worker, PID %d", *(int32 *) arg); } /* -- cgit v1.2.3