Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit355917c

Browse files
nbtree VACUUM: cope with topparent inconsistencies.
Avoid "right sibling %u of block %u is not next child" errors whenvacuuming a corrupt nbtree index. Just LOG the issue and press on.That way VACUUM will have a decent chance of finishing off all requiredprocessing for the index (and for the table as a whole).This is similar to recent work from commit5abff19, as well as workfrom commit5b861ba (later backpatched as commit43e409c), whichtaught nbtree VACUUM to keep going when its "re-find" check fails. Thehardening added by this commit takes place directly after the "re-find"check, right before the critical section for the first stage of pagedeletion.Author: Peter Geoghegan <pg@bowt.ie>Discussion:https://postgr.es/m/CAH2-Wz=dayg0vjs4+er84TS9ami=csdzjpuiCGbEw=idhwqhzQ@mail.gmail.comBackpatch: 11- (all supported versions).
1 parent9b4c44f commit355917c

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

‎src/backend/access/nbtree/nbtpage.c

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1686,9 +1686,19 @@ _bt_mark_page_halfdead(Relation rel, Buffer leafbuf, BTStack stack)
16861686
itemid=PageGetItemId(page,nextoffset);
16871687
itup= (IndexTuple)PageGetItem(page,itemid);
16881688
if (BTreeInnerTupleGetDownLink(itup)!=rightsib)
1689-
elog(ERROR,"right sibling %u of block %u is not next child %u of block %u in index \"%s\"",
1690-
rightsib,target,BTreeInnerTupleGetDownLink(itup),
1691-
BufferGetBlockNumber(topparent),RelationGetRelationName(rel));
1689+
{
1690+
ereport(LOG,
1691+
(errcode(ERRCODE_INDEX_CORRUPTED),
1692+
errmsg_internal("right sibling %u of block %u is not next child %u of block %u in index \"%s\"",
1693+
rightsib,target,
1694+
BTreeInnerTupleGetDownLink(itup),
1695+
BufferGetBlockNumber(topparent),
1696+
RelationGetRelationName(rel))));
1697+
1698+
_bt_relbuf(rel,topparent);
1699+
1700+
return false;
1701+
}
16921702

16931703
/*
16941704
* Any insert which would have gone on the leaf block will now go to its

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp