aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/backend/access/nbtree/nbtpage.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/backend/access/nbtree/nbtpage.c b/src/backend/access/nbtree/nbtpage.c
index 5ebfd845cf8..0d731b18016 100644
--- a/src/backend/access/nbtree/nbtpage.c
+++ b/src/backend/access/nbtree/nbtpage.c
@@ -1686,9 +1686,19 @@ _bt_mark_page_halfdead(Relation rel, Buffer leafbuf, BTStack stack)
itemid = PageGetItemId(page, nextoffset);
itup = (IndexTuple) PageGetItem(page, itemid);
if (BTreeInnerTupleGetDownLink(itup) != rightsib)
- elog(ERROR, "right sibling %u of block %u is not next child %u of block %u in index \"%s\"",
- rightsib, target, BTreeInnerTupleGetDownLink(itup),
- BufferGetBlockNumber(topparent), RelationGetRelationName(rel));
+ {
+ ereport(LOG,
+ (errcode(ERRCODE_INDEX_CORRUPTED),
+ errmsg_internal("right sibling %u of block %u is not next child %u of block %u in index \"%s\"",
+ rightsib, target,
+ BTreeInnerTupleGetDownLink(itup),
+ BufferGetBlockNumber(topparent),
+ RelationGetRelationName(rel))));
+
+ _bt_relbuf(rel, topparent);
+
+ return false;
+ }
/*
* Any insert which would have gone on the leaf block will now go to its