Restore sane locking behavior during parallel query.
Tom Lane <tgl@sss.pgh.pa.us>
Restore sane locking behavior during parallel query. Commit 9a3cebeaa changed things so that parallel workers didn't obtain any lock of their own on tables they access. That was clearly a bad idea, but I'd mistakenly supposed that it was the intended end result of the series of patches for simplifying the executor's lock management. Undo that change in relation_open(), and adjust ExecOpenScanRelation() so that it gets the correct lock if inside a parallel worker. In passing, clean up some more obsolete comments about when locks are acquired. Discussion: https://postgr.es/m/468c85d9-540e-66a2-1dde-fec2b741e688@lab.ntt.co.jp
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/access/heap/heapam.c | modified | +0 −4 |
| src/backend/executor/execMain.c | modified | +2 −2 |
| src/backend/executor/execUtils.c | modified | +23 −9 |
| src/backend/executor/nodeBitmapHeapscan.c | modified | +1 −5 |
| src/backend/executor/nodeCustom.c | modified | +1 −1 |
| src/backend/executor/nodeForeignscan.c | modified | +2 −2 |
| src/backend/executor/nodeIndexonlyscan.c | modified | +1 −1 |
| src/backend/executor/nodeIndexscan.c | modified | +1 −1 |
| src/backend/executor/nodeSamplescan.c | modified | +1 −4 |
| src/backend/executor/nodeSeqscan.c | modified | +1 −4 |
| src/backend/executor/nodeTidscan.c | modified | +1 −1 |
Discussion
- executor relation handling 62 messages · 2018-08-16 → 2019-02-10