amcheck: Distinguish interrupted page deletion from corruption.
authorNoah Misch <noah@leadboat.com>
Mon, 30 Oct 2023 21:46:05 +0000 (14:46 -0700)
committerNoah Misch <noah@leadboat.com>
Mon, 30 Oct 2023 21:46:08 +0000 (14:46 -0700)
commit6f81386a9cea39b83e24943224569ec18557163c
treed38d3576d56853827f1f9569900f31ec59906235
parent5f06918399f07d46c15756bea84d8d5665ebfa57
amcheck: Distinguish interrupted page deletion from corruption.

This prevents false-positive reports about "the first child of leftmost
target page is not leftmost of its level", "block %u is not leftmost"
and "left link/right link pair".  They appeared if amcheck ran before
VACUUM cleaned things, after a cluster exited recovery between the
first-stage and second-stage WAL records of a deletion.  Back-patch to
v11 (all supported versions).

Reviewed by Peter Geoghegan.

Discussion: https://postgr.es/m/20231005025232.c7.nmisch@google.com
contrib/amcheck/Makefile
contrib/amcheck/t/005_pitr.pl [new file with mode: 0644]
contrib/amcheck/verify_nbtree.c