1
0
mirror of https://github.com/postgres/postgres.git synced 2025-04-22 23:02:54 +03:00

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.
This commit is contained in:
Peter Geoghegan 2020-11-05 15:01:40 -08:00
parent 5b7bfc3972
commit efc5dcfd8a

View File

@ -824,6 +824,8 @@ btree_xlog_unlink_page(uint8 info, XLogReaderState *record)
pageop->btpo_next = rightsib; pageop->btpo_next = rightsib;
pageop->btpo.xact = xlrec->btpo_xact; pageop->btpo.xact = xlrec->btpo_xact;
pageop->btpo_flags = BTP_DELETED; pageop->btpo_flags = BTP_DELETED;
if (!BlockNumberIsValid(xlrec->topparent))
pageop->btpo_flags |= BTP_LEAF;
pageop->btpo_cycleid = 0; pageop->btpo_cycleid = 0;
PageSetLSN(page, lsn); PageSetLSN(page, lsn);