Improve Asserts checking relation matching in parallel scans.
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 20 Sep 2024 20:37:55 +0000 (16:37 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 20 Sep 2024 20:37:55 +0000 (16:37 -0400)
commit54562c9cfa2281b6303cdea1aff9596c4a5de4b2
tree2586f1fb924f5c473421501e4e188b307581e2b2
parentafb03e2ebf595c057db0372f543f9f796effaadf
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
src/backend/access/index/indexam.c
src/backend/access/table/tableam.c
src/include/access/relscan.h