修复访问已被release buffer问题

This commit is contained in:
lyanna
2024-09-23 16:16:57 +08:00
parent 92a5ac8935
commit f1ceac6ee7

View File

@ -869,6 +869,7 @@ static bool UBTreeMarkPageHalfDead(Relation rel, Buffer leafbuf, BTStack stack)
itemid = PageGetItemId(page, nextoffset);
itup = (IndexTuple) PageGetItem(page, itemid);
if (UBTreeTupleGetDownLink(itup) != rightsib) {
OffsetNumber topparentblkno = BufferGetBlockNumber(topparent);
_bt_relbuf(rel, topparent);
Buffer rbuf = _bt_getbuf(rel, rightsib, BT_READ);
Page rpage = BufferGetPage(rbuf);
@ -880,7 +881,7 @@ static bool UBTreeMarkPageHalfDead(Relation rel, Buffer leafbuf, BTStack stack)
}
elog(ERROR, "right sibling %u of block %u is not next child %u of block %u in index \"%s\"",
rightsib, target, UBTreeTupleGetDownLink(itup) != rightsib,
BufferGetBlockNumber(topparent), RelationGetRelationName(rel));
topparentblkno, RelationGetRelationName(rel));
}
/*