postgres.git / summary / log / commit / refs

commit    efc5dcfd8ad4e1df633025d8a91b64cd44d93f42
Author:   Peter Geoghegan <pg@bowt.ie>
Date:     Thu Nov 05 23:01:40 2020 +0000
First released in: 14.0

    Fix wal_consistency_checking nbtree bug.
    
    wal_consistency_checking indicated an inconsistency in certain cases
    involving nbtree page deletion.  The underlying issue is that there was
    a minor difference between the page image produced after a REDO routine
    ran and the corresponding page image following original execution.
    
    This harmless inconsistency has been around forever.  We more or less
    expect total consistency among even deleted nbtree pages these days,
    though, so this won't do anymore.
    
    To fix, tweak the REDO routine to match original execution.
    
    Oversight in commit f47b5e13.


src/backend/access/nbtree/nbtxlog.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/backend/access/nbtree/nbtxlog.c b/src/backend/access/nbtree/nbtxlog.c index bda9be23489..e9132267604 100644 --- a/src/backend/access/nbtree/nbtxlog.c +++ b/src/backend/access/nbtree/nbtxlog.c @@ -824,6 +824,8 @@ btree_xlog_unlink_page(uint8 info, XLogReaderState *record) pageop->btpo_next = rightsib; pageop->btpo.xact = xlrec->btpo_xact; pageop->btpo_flags = BTP_DELETED; + if (!BlockNumberIsValid(xlrec->topparent)) + pageop->btpo_flags |= BTP_LEAF; pageop->btpo_cycleid = 0; PageSetLSN(page, lsn); [parent: 5b7bfc39726f]