amcheck: Distinguish interrupted page deletion from corruption.

Noah Misch <noah@leadboat.com>

Commit: 3c6a05b805c750771dc6d3471ca32b27eb25b33e
Author: Noah Misch <noah@leadboat.com>
Date: 2023-10-30T21:46:08Z
Releases: 16.1
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

Files

PathChange+/−
contrib/amcheck/Makefile modified +1 −0
contrib/amcheck/meson.build modified +1 −0
contrib/amcheck/t/005_pitr.pl added +82 −0
contrib/amcheck/verify_nbtree.c modified +79 −4

Discussion