pgsql: Fix amcheck's handling of half-dead B-tree pages

From: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix amcheck's handling of half-dead B-tree pages
Date: 2025-12-02 19:27:03
Message-ID: E1vQW1e-002TcC-2X@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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 <knizhnik(at)garret(dot)ru>
Reviewed-by: Peter Geoghegan <pg(at)bowt(dot)ie>
Reviewed-by: Mihail Nikalayeu <mihailnikalayeu(at)gmail(dot)com>
Discussion: https://www.postgresql.org/message-id/33e39552-6a2a-46f3-8b34-3f9f8004451f@garret.ru
Backpatch-through: 14

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/e8ae594458a3813006af963d7547b206640762b9

Modified Files
--------------
contrib/amcheck/verify_nbtree.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Nathan Bossart 2025-12-02 22:40:48 pgsql: Use LW_SHARED in dsa.c where possible.
Previous Message Nathan Bossart 2025-12-02 16:31:25 pgsql: Show size of DSAs and dshashes in pg_dsm_registry_allocations.