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

Commit3d8d578

Browse files
Fix nbtree page deletion error messages.
Adjust some "can't happen" error messages that assumed that the pagedeletion target page must be a half-dead page. This assumption waswrong in the case of an internal target page. Simply refer to thesepages as the target page instead.Internal pages are never marked half-dead. There is exactly onehalf-dead page for each subtree undergoing deletion. The half-dead pageis also the target subtree's leaf-level page. This has been the casesince commitefada2b, which totally overhauled nbtree page deletion.
1 parentd16f8c8 commit3d8d578

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2420,20 +2420,21 @@ _bt_unlink_halfdead_page(Relation rel, Buffer leafbuf, BlockNumber scanblkno,
24202420
* only one vacuum process running at a time.
24212421
*/
24222422
if (P_RIGHTMOST(opaque)||P_ISROOT(opaque)||P_ISDELETED(opaque))
2423-
elog(ERROR,"half-dead page changed status unexpectedly in block %u of index \"%s\"",
2423+
elog(ERROR,"target page changed status unexpectedly in block %u of index \"%s\"",
24242424
target,RelationGetRelationName(rel));
24252425

24262426
if (opaque->btpo_prev!=leftsib)
24272427
ereport(ERROR,
24282428
(errcode(ERRCODE_INDEX_CORRUPTED),
2429-
errmsg_internal("left link changed unexpectedly in block %u of index \"%s\"",
2430-
target,RelationGetRelationName(rel))));
2429+
errmsg_internal("target page left link unexpectedly changed from %u to %u in block %u of index \"%s\"",
2430+
leftsib,opaque->btpo_prev,target,
2431+
RelationGetRelationName(rel))));
24312432

24322433
if (target==leafblkno)
24332434
{
24342435
if (P_FIRSTDATAKEY(opaque) <=PageGetMaxOffsetNumber(page)||
24352436
!P_ISLEAF(opaque)|| !P_ISHALFDEAD(opaque))
2436-
elog(ERROR,"half-dead page changed status unexpectedly in block %u of index \"%s\"",
2437+
elog(ERROR,"target leaf page changed status unexpectedly in block %u of index \"%s\"",
24372438
target,RelationGetRelationName(rel));
24382439

24392440
/* Leaf page is also target page: don't set leaftopparent */
@@ -2445,8 +2446,8 @@ _bt_unlink_halfdead_page(Relation rel, Buffer leafbuf, BlockNumber scanblkno,
24452446

24462447
if (P_FIRSTDATAKEY(opaque)!=PageGetMaxOffsetNumber(page)||
24472448
P_ISLEAF(opaque))
2448-
elog(ERROR,"half-deadpage changed status unexpectedly in block %u of index \"%s\"",
2449-
target,RelationGetRelationName(rel));
2449+
elog(ERROR,"target internalpage on level %u changed status unexpectedly in block %u of index \"%s\"",
2450+
targetlevel,target,RelationGetRelationName(rel));
24502451

24512452
/* Target is internal: set leaftopparent for next call here... */
24522453
itemid=PageGetItemId(page,P_FIRSTDATAKEY(opaque));

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp