postgresql/src/backend/access
Peter Geoghegan e7428a99a1 Add hardening to catch invalid TIDs in indexes.
Add hardening to the heapam index tuple deletion path to catch TIDs in
index pages that point to a heap item that index tuples should never
point to.  The corruption we're trying to catch here is particularly
tricky to detect, since it typically involves "extra" (corrupt) index
tuples, as opposed to the absence of required index tuples in the index.

For example, a heap TID from an index page that turns out to point to an
LP_UNUSED item in the heap page has a good chance of being caught by one
of the new checks.  There is a decent chance that the recently fixed
parallel VACUUM bug (see commit 9bacec15) would have been caught had
that particular check been in place for Postgres 14.  No backpatch of
this extra hardening for now, though.

Author: Peter Geoghegan <pg@bowt.ie>
Reviewed-By: Andres Freund <andres@anarazel.de>
Discussion: https://postgr.es/m/CAH2-Wzk-4_raTzawWGaiqNvkpwDXxv3y1AQhQyUeHfkU=tFCeA@mail.gmail.com
2021-11-04 19:54:05 -07:00
..
brin Replace unicode characters in comments with ascii 2021-11-01 22:42:49 +01:00
common Revert analyze support for partitioned tables 2021-08-16 17:27:52 -04:00
gin Clean up some code using "(expr) ? true : false" 2021-09-08 09:44:04 +09:00
gist Clean up more code using "(expr) ? true : false" 2021-10-11 09:36:42 +09:00
hash Clean up some code using "(expr) ? true : false" 2021-09-08 09:44:04 +09:00
heap Add hardening to catch invalid TIDs in indexes. 2021-11-04 19:54:05 -07:00
index Add hardening to catch invalid TIDs in indexes. 2021-11-04 19:54:05 -07:00
nbtree Add hardening to catch invalid TIDs in indexes. 2021-11-04 19:54:05 -07:00
rmgrdesc Fix WAL replay in presence of an incomplete record 2021-09-29 11:21:51 -03:00
spgist Count SP-GiST index scans in pg_stat statistics. 2021-08-27 19:53:05 -04:00
table Replace RelationOpenSmgr() with RelationGetSmgr(). 2021-07-12 17:01:36 -04:00
tablesample Update copyright for 2021 2021-01-02 13:06:25 -05:00
transam Move MarkCurrentTransactionIdLoggedIfAny() out of the critical section. 2021-11-02 09:11:05 +05:30
Makefile Introduce access/{table.h, relation.h}, for generic functions from heapam.h. 2019-01-21 10:51:36 -08:00