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

Commit46cf3c7

Browse files
nbtree: Demote incomplete split "can't happen" error.
Only a basic logic bug in a _bt_insertonpg() caller could lead to aviolation of this invariant (index corruption won't do it). A "can'thappen" error seems inappropriate (it is arbitrary at best).Demote the error to a simple assertion. This matches similar nearbysanity checks.
1 parentff94205 commit46cf3c7

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1129,6 +1129,8 @@ _bt_insertonpg(Relation rel,
11291129
IndexRelationGetNumberOfKeyAttributes(rel));
11301130
Assert(!BTreeTupleIsPosting(itup));
11311131
Assert(MAXALIGN(IndexTupleSize(itup))==itemsz);
1132+
/* Caller must always finish incomplete split for us */
1133+
Assert(!P_INCOMPLETE_SPLIT(lpageop));
11321134

11331135
/*
11341136
* Every internal page should have exactly one negative infinity item at
@@ -1138,11 +1140,6 @@ _bt_insertonpg(Relation rel,
11381140
*/
11391141
Assert(P_ISLEAF(lpageop)||newitemoff>P_FIRSTDATAKEY(lpageop));
11401142

1141-
/* The caller should've finished any incomplete splits already. */
1142-
if (P_INCOMPLETE_SPLIT(lpageop))
1143-
elog(ERROR,"cannot insert to incompletely split page %u",
1144-
BufferGetBlockNumber(buf));
1145-
11461143
/*
11471144
* Do we need to split an existing posting list item?
11481145
*/

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp