Add new function WaitForParallelWorkersToAttach.
Robert Haas <rhaas@postgresql.org>
Add new function WaitForParallelWorkersToAttach. Once this function has been called, we know that all workers have started and attached to their error queues -- so if any of them subsequently exit uncleanly, we'll be sure to throw an ERROR promptly. Otherwise, users of the ParallelContext machinery must be careful not to wait forever for a worker that has failed to start. Parallel query manages to work without needing this for reasons explained in new comments added by this patch, but it's a useful primitive for other parallel operations, such as the pending patch to make creating a btree index run in parallel. Amit Kapila, revised by me. Additional review by Peter Geoghegan. Discussion: http://postgr.es/m/CAA4eK1+e2MzyouF5bg=OtyhDSX+=Ao=3htN=T-r_6s3gCtKFiw@mail.gmail.com
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/access/transam/parallel.c | modified | +144 −8 |
| src/backend/executor/nodeGather.c | modified | +8 −1 |
| src/backend/executor/nodeGatherMerge.c | modified | +8 −1 |
| src/include/access/parallel.h | modified | +3 −1 |
Discussion
- Wait for parallel workers to attach 13 messages · 2018-01-27 → 2018-02-02