pgsql: Improve Asserts checking relation matching in parallel scans.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Improve Asserts checking relation matching in parallel scans.
Date: 2024-09-20 20:38:04
Message-ID: E1srkOC-000Cr5-98@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Geoghegan 2024-09-21 17:26:10 pgsql: Refactor handling of nbtree array redundancies.
Previous Message Tom Lane 2024-09-20 20:19:46 pgsql: Doc: update 17.0 release date.