nbtree page deletion: Add leaftopparent assertion.

Add documenting assertion.  This makes it easier to follow how we
maintain the top parent link in target subtree's half-dead/leaf level
page.
This commit is contained in:
Peter Geoghegan 2021-03-02 14:06:07 -08:00
parent 3d8d5787a3
commit 5b2f2af3d9
2 changed files with 4 additions and 1 deletions

View File

@ -2458,6 +2458,9 @@ _bt_unlink_halfdead_page(Relation rel, Buffer leafbuf, BlockNumber scanblkno,
leaftopparent = InvalidBlockNumber;
}
/* No leaftopparent for level 0 (leaf page) or level 1 target */
Assert(!BlockNumberIsValid(leaftopparent) || targetlevel > 1);
/*
* And next write-lock the (current) right sibling.
*/

View File

@ -818,7 +818,7 @@ btree_xlog_unlink_page(uint8 info, XLogReaderState *record)
safexid = xlrec->safexid;
/* No leaftopparent for level 0 (leaf page) or level 1 target */
Assert(xlrec->leaftopparent == InvalidBlockNumber || level > 1);
Assert(!BlockNumberIsValid(xlrec->leaftopparent) || level > 1);
/*
* In normal operation, we would lock all the pages this WAL record