Commit 5b2f2af3 authored by Peter Geoghegan's avatar Peter Geoghegan

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.
parent 3d8d5787
......@@ -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.
*/
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment