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

Commit19cd31b

Browse files
committed
Fix bug introduced into _bt_getstackbuf() on 2003-Feb-21: the initial
value of 'start' could be past the end of the page, if the page wassplit by some concurrent inserting process since we visited it. Inthis situation the code could look at bogus entries and possibly finda match (since after all those entries still contain what they hadbefore the split). This would lead to 'specified item offset is too large'followed by 'PANIC: failed to add item to the page', as reported by JoeConway for scenarios involving heavy concurrent insertion activity.
1 parentfcaad7e commit19cd31b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.113 2004/07/21 22:31:19 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.114 2004/08/17 23:15:33 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -1311,6 +1311,13 @@ _bt_getstackbuf(Relation rel, BTStack stack, int access)
13111311
if (start<minoff)
13121312
start=minoff;
13131313

1314+
/*
1315+
* Need this check too, to guard against possibility that page
1316+
* split since we visited it originally.
1317+
*/
1318+
if (start>maxoff)
1319+
start=OffsetNumberNext(maxoff);
1320+
13141321
/*
13151322
* These loops will check every item on the page --- but in an
13161323
* order that's attuned to the probability of where it

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp