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

Commit5c62ecf

Browse files
committed
Don't release index root page pin in ginFindParents().
It's clearly stated in the comments that ginFindParents() must keepthe pin on the index's root page that's associated with the topmostGinBtreeStack item. However, the code path for the case that thedesired downlink has been pushed down to the next index levelignored this proviso, and would release the pin anyway if we werestill examining the root level. That led to an assertion failureor "buffer NNNN is not owned by resource owner" error later, whenwe try to release the pin again at the end of the insertion.This is quite hard to reproduce, since it can only happen if anindex root page split occurs concurrently with our own insertion.Thanks to Jeff Janes for finding a test case that triggers itoften enough to allow investigation.This has been there since the beginning of GIN, so back-patchto all supported branches.Discussion:https://postgr.es/m/CAMkU=1yCAKtv86dMrD__Ja-7KzjE=uMeKX8y__cx5W-OEWy2ow@mail.gmail.com
1 parentc3fd6a1 commit5c62ecf

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

‎src/backend/access/gin/ginbtree.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,11 @@ ginFindParents(GinBtree btree, GinBtreeStack *stack)
272272
blkno=GinPageGetOpaque(page)->rightlink;
273273
if (blkno==InvalidBlockNumber)
274274
{
275-
UnlockReleaseBuffer(buffer);
275+
/* Link not present in this level */
276+
LockBuffer(buffer,GIN_UNLOCK);
277+
/* Do not release pin on the root buffer */
278+
if (buffer!=root->buffer)
279+
ReleaseBuffer(buffer);
276280
break;
277281
}
278282
buffer=ginStepRight(buffer,btree->index,GIN_EXCLUSIVE);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp