Fix amcheck's handling of half-dead B-tree pages
authorHeikki Linnakangas <[email protected]>
Tue, 2 Dec 2025 19:11:15 +0000 (21:11 +0200)
committerHeikki Linnakangas <[email protected]>
Tue, 2 Dec 2025 19:16:06 +0000 (21:16 +0200)
commit7792bdc45860ad9f0e7188ce2113f799a074034d
tree9e67beaca4b0e2b6ef0a194d3a2e4e1357cdab56
parent721b58fbec5f4a167540177659a2502383bc0c58
Fix amcheck's handling of half-dead B-tree pages

amcheck incorrectly reported the following error if there were any
half-dead pages in the index:

ERROR:  mismatch between parent key and child high key in index
"amchecktest_id_idx"

It's expected that a half-dead page does not have a downlink in the
parent level, so skip the test.

Reported-by: Konstantin Knizhnik <[email protected]>
Reviewed-by: Peter Geoghegan <[email protected]>
Reviewed-by: Mihail Nikalayeu <[email protected]>
Discussion: https://www.postgresql.org/message-id/33e39552-6a2a-46f3-8b34-3f9f8004451f@garret.ru
Backpatch-through: 14
contrib/amcheck/verify_nbtree.c