Rethinking parallel-scan relation identity checks

Started by Tom Laneover 1 year ago1 messageshackers
Jump to latest
#1Tom Lane
tgl@sss.pgh.pa.us

In [1]/messages/by-id/2042942.1726781733@sss.pgh.pa.us I whined about how the parallel heap scan machinery should have
noticed that the same ParallelTableScanDesc was being used to give out
block numbers for two different relations. Looking closer, there
are Asserts that mean to catch this type of error --- but they are
comparing relation OIDs, whereas what would have been needed to detect
the problem was to compare RelFileLocators.

It seems to me that a scan is fundamentally operating at the physical
relation level, and therefore these tests should check RelFileLocators
not OIDs. Hence I propose the attached. (For master only, of course;
this would be an ABI break in the back branches.) This passes
check-world and is able to catch the problem exposed in the other
thread.

Another possible view is that we should check both physical and
logical relation IDs, but that seems like overkill to me.

Thoughts?

regards, tom lane

[1]: /messages/by-id/2042942.1726781733@sss.pgh.pa.us

Attachments:

check-parallel-scan-locators-not-OIDs.patchtext/x-diff; charset=us-ascii; name=check-parallel-scan-locators-not-OIDs.patchDownload+11-8