Skip to content

Commit efc5dcf

Browse files
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 f47b5e1.
1 parent 5b7bfc3 commit efc5dcf

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/backend/access/nbtree/nbtxlog.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -824,6 +824,8 @@ btree_xlog_unlink_page(uint8 info, XLogReaderState *record)
824824
pageop->btpo_next = rightsib;
825825
pageop->btpo.xact = xlrec->btpo_xact;
826826
pageop->btpo_flags = BTP_DELETED;
827+
if (!BlockNumberIsValid(xlrec->topparent))
828+
pageop->btpo_flags |= BTP_LEAF;
827829
pageop->btpo_cycleid = 0;
828830

829831
PageSetLSN(page, lsn);

0 commit comments

Comments
 (0)