pgsql: Improve Asserts checking relation matching in parallel scans. - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Improve Asserts checking relation matching in parallel scans.
Date
Msg-id E1srkOC-000Cr5-98@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Improve Asserts checking relation matching in parallel scans.

table_beginscan_parallel and index_beginscan_parallel contain
Asserts checking that the relation a worker will use in
a parallel scan is the same one the leader intended.  However,
they were checking for relation OID match, which was not strong
enough to detect the mismatch problem fixed in 126ec0bc7.
What would be strong enough is to compare relfilenodes instead.
Arguably, that's a saner definition anyway, since a scan surely
operates on a physical relation not a logical one.  Hence,
store and compare RelFileLocators not relation OIDs.  Also
ensure that index_beginscan_parallel checks the index identity
not just the table identity.

Discussion: https://postgr.es/m/2127254.1726789524@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/54562c9cfa2281b6303cdea1aff9596c4a5de4b2

Modified Files
--------------
src/backend/access/index/indexam.c | 8 +++++---
src/backend/access/table/tableam.c | 4 ++--
src/include/access/relscan.h       | 7 ++++---
3 files changed, 11 insertions(+), 8 deletions(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Doc: update 17.0 release date.
Next
From: Peter Geoghegan
Date:
Subject: pgsql: Refactor handling of nbtree array redundancies.