postgres.git / summary / log / commit / refs

commit    fbb4b607832d470c804756345474e51cdfdfa099
Author:   Heikki Linnakangas <heikki.linnakangas@iki.fi>
Date:     Tue Dec 02 19:11:15 2025 +0000

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


contrib/amcheck/verify_nbtree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/amcheck/verify_nbtree.c b/contrib/amcheck/verify_nbtree.c index b36a081808d..f9afb4d7bd0 100644 --- a/contrib/amcheck/verify_nbtree.c +++ b/contrib/amcheck/verify_nbtree.c @@ -2047,7 +2047,7 @@ bt_child_highkey_check(BtreeCheckState *state, * If we visit page with high key, check that it is equal to the * target key next to corresponding downlink. */ - if (!rightsplit && !P_RIGHTMOST(opaque)) + if (!rightsplit && !P_RIGHTMOST(opaque) && !P_ISHALFDEAD(opaque)) { BTPageOpaque topaque; IndexTuple highkey; [parent: a4cb21ea9cd7]