aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/transam/README.parallel
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2015-10-30 10:43:00 +0100
committerRobert Haas <rhaas@postgresql.org>2015-10-30 10:44:54 +0100
commit3a1f8611f2582df0a16bcd35caed2e1526387643 (patch)
treea246c057e24fd1a8870194a1d1ff3bf3e15ebb58 /src/backend/access/transam/README.parallel
parentc6baec92fc48387da8164d50f5699a7162267718 (diff)
downloadpostgresql-3a1f8611f2582df0a16bcd35caed2e1526387643.tar.gz
postgresql-3a1f8611f2582df0a16bcd35caed2e1526387643.zip
Update parallel executor support to reuse the same DSM.
Commit b0b0d84b3d663a148022e900ebfc164284a95f55 purported to make it possible to relaunch workers using the same parallel context, but it had an unpleasant race condition: we might reinitialize after the workers have sent their last control message but before they have dettached the DSM, leaving to crashes. Repair by introducing a new ParallelContext operation, ReinitializeParallelDSM. Adjust execParallel.c to use this new support, so that we can rescan a Gather node by relaunching workers but without needing to recreate the DSM. Amit Kapila, with some adjustments by me. Extracted from latest parallel sequential scan patch.
Diffstat (limited to 'src/backend/access/transam/README.parallel')
-rw-r--r--src/backend/access/transam/README.parallel10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/backend/access/transam/README.parallel b/src/backend/access/transam/README.parallel
index dfcbafabf08..db9ac3d504d 100644
--- a/src/backend/access/transam/README.parallel
+++ b/src/backend/access/transam/README.parallel
@@ -222,7 +222,9 @@ pattern looks like this:
ExitParallelMode();
-If desired, after WaitForParallelWorkersToFinish() has been called, another
-call to LaunchParallelWorkers() can be made using the same parallel context.
-Calls to these two functions can be alternated any number of times before
-destroying the parallel context.
+If desired, after WaitForParallelWorkersToFinish() has been called, the
+context can be reset so that workers can be launched anew using the same
+parallel context. To do this, first call ReinitializeParallelDSM() to
+reinitialize state managed by the parallel context machinery itself; then,
+perform any other necessary resetting of state; after that, you can again
+call LaunchParallelWorkers.