1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-16 06:01:02 +03:00

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
This commit is contained in:
Tom Lane
2018-10-06 15:49:37 -04:00
parent f2343653f5
commit 29ef2b310d
11 changed files with 34 additions and 34 deletions

View File

@ -1622,8 +1622,8 @@ ExecEndPlan(PlanState *planstate, EState *estate)
}
/*
* close whatever rangetable Relations have been opened. We did not
* acquire locks in ExecGetRangeTableRelation, so don't release 'em here.
* close whatever rangetable Relations have been opened. We do not
* release any locks we might hold on those rels.
*/
num_relations = estate->es_range_table_size;
for (i = 0; i < num_relations; i++)