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

Commit5b861ba

Browse files
nbtree VACUUM: Cope with buggy opclasses.
Teach nbtree VACUUM to press on with vacuuming in the event of a pagedeletion attempt that fails to "re-find" a downlink for its child/targetpage.There is no good reason to treat this as an irrecoverable error. Butthere is a good reason not to: pressing on at this point removes anyquestion of VACUUM not making progress solely due to misbehavior fromuser-defined operator class code.Discussion:https://postgr.es/m/CAH2-Wzma5G9CTtMjbrXTwOym+U=aWg-R7=-htySuztgoJLvZXg@mail.gmail.com
1 parent87d90ac commit5b861ba

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

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

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2791,10 +2791,26 @@ _bt_lock_subtree_parent(Relation rel, BlockNumber child, BTStack stack,
27912791
*/
27922792
pbuf=_bt_getstackbuf(rel,stack,child);
27932793
if (pbuf==InvalidBuffer)
2794-
ereport(ERROR,
2794+
{
2795+
/*
2796+
* Failed to "re-find" a pivot tuple whose downlink matched our child
2797+
* block number on the parent level -- the index must be corrupt.
2798+
* Don't even try to delete the leafbuf subtree. Just report the
2799+
* issue and press on with vacuuming the index.
2800+
*
2801+
* Note: _bt_getstackbuf() recovers from concurrent page splits that
2802+
* take place on the parent level. Its approach is a near-exhaustive
2803+
* linear search. This also gives it a surprisingly good chance of
2804+
* recovering in the event of a buggy or inconsistent opclass. But we
2805+
* don't rely on that here.
2806+
*/
2807+
ereport(LOG,
27952808
(errcode(ERRCODE_INDEX_CORRUPTED),
27962809
errmsg_internal("failed to re-find parent key in index \"%s\" for deletion target page %u",
27972810
RelationGetRelationName(rel),child)));
2811+
return false;
2812+
}
2813+
27982814
parent=stack->bts_blkno;
27992815
parentoffset=stack->bts_offset;
28002816

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp