Skip to content

Commit 5b2f2af

Browse files
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.
1 parent 3d8d578 commit 5b2f2af

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/backend/access/nbtree/nbtpage.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2458,6 +2458,9 @@ _bt_unlink_halfdead_page(Relation rel, Buffer leafbuf, BlockNumber scanblkno,
24582458
leaftopparent = InvalidBlockNumber;
24592459
}
24602460

2461+
/* No leaftopparent for level 0 (leaf page) or level 1 target */
2462+
Assert(!BlockNumberIsValid(leaftopparent) || targetlevel > 1);
2463+
24612464
/*
24622465
* And next write-lock the (current) right sibling.
24632466
*/

src/backend/access/nbtree/nbtxlog.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,7 @@ btree_xlog_unlink_page(uint8 info, XLogReaderState *record)
818818
safexid = xlrec->safexid;
819819

820820
/* No leaftopparent for level 0 (leaf page) or level 1 target */
821-
Assert(xlrec->leaftopparent == InvalidBlockNumber || level > 1);
821+
Assert(!BlockNumberIsValid(xlrec->leaftopparent) || level > 1);
822822

823823
/*
824824
* In normal operation, we would lock all the pages this WAL record

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy