From 29ef2b310da9892fda075ff9ee12da7f92d5da6e Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sat, 6 Oct 2018 15:49:37 -0400 Subject: 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 --- src/backend/executor/nodeSeqscan.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/backend/executor/nodeSeqscan.c') diff --git a/src/backend/executor/nodeSeqscan.c b/src/backend/executor/nodeSeqscan.c index 5dede816c6a..79729dbbecb 100644 --- a/src/backend/executor/nodeSeqscan.c +++ b/src/backend/executor/nodeSeqscan.c @@ -163,10 +163,7 @@ ExecInitSeqScan(SeqScan *node, EState *estate, int eflags) ExecAssignExprContext(estate, &scanstate->ss.ps); /* - * Initialize scan relation. - * - * Get the relation object id from the relid'th entry in the range table, - * open that relation and acquire appropriate lock on it. + * open the scan relation */ scanstate->ss.ss_currentRelation = ExecOpenScanRelation(estate, -- cgit v1.2.3