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

Commitb8403d1

Browse files
committed
Fix bug in detecting concurrent page splits in GiST insert
In commit9eb5607, I got the condition on checking for split ordeleted page wrong: I used && instead of ||. The comment correctly said"concurrent split _or_ deletion".As a result, GiST insertion could miss a concurrent split, and insert towrong page. Duncan Sands demonstrated this with a test script that did alot of concurrent inserts.Backpatch to v12, where this was introduced. REINDEX is required to fixindexes that were affected by this bug.Backpatch-through: 12Reported-by: Duncan SandsDiscussion:https://www.postgresql.org/message-id/a9690483-6c6c-3c82-c8ba-dc1a40848f11%40deepbluecap.com
1 parent31e0f9d commitb8403d1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

‎src/backend/access/gist/gist.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,9 @@ gistplacetopage(Relation rel, Size freespace, GISTSTATE *giststate,
246246
if (GistFollowRight(page))
247247
elog(ERROR,"concurrent GiST page split was incomplete");
248248

249+
/* should never try to insert to a deleted page */
250+
Assert(!GistPageIsDeleted(page));
251+
249252
*splitinfo=NIL;
250253

251254
/*
@@ -861,7 +864,7 @@ gistdoinsert(Relation r, IndexTuple itup, Size freespace,
861864
*/
862865
}
863866
elseif ((GistFollowRight(stack->page)||
864-
stack->parent->lsn<GistPageGetNSN(stack->page))&&
867+
stack->parent->lsn<GistPageGetNSN(stack->page))||
865868
GistPageIsDeleted(stack->page))
866869
{
867870
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp