!6416 reinforce checkneedswitch
Merge pull request !6416 from lyannaa/checkundozone
This commit is contained in:
@ -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));
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@ -56,10 +56,8 @@ bool CheckNeedSwitch(UndoPersistence upersistence)
|
||||
if (uzone == NULL) {
|
||||
ereport(PANIC, (errmsg("CheckNeedSwitch: uzone is NULL")));
|
||||
}
|
||||
if ((uint64)UNDO_PTR_GET_OFFSET(uzone->GetInsertURecPtr()) + UNDO_LOG_SEGMENT_SIZE > UNDO_LOG_MAX_SIZE) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
return uzone->CheckNeedSwitch();
|
||||
}
|
||||
|
||||
void RollbackIfUndoExceeds(TransactionId xid, uint64 size)
|
||||
|
||||
Reference in New Issue
Block a user