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

Commitc9a2b6d

Browse files
committed
Fix thinko in gistRedoPageUpdateRecord: if XLR_BKP_BLOCK_1 is set, we
don't have anything to do to the page, but we still have to adjust theincomplete_inserts list that we're maintaining in memory.
1 parent8d02b15 commitc9a2b6d

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

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

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/access/gist/gistxlog.c,v 1.14 2006/03/31 23:32:05 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/access/gist/gistxlog.c,v 1.15 2006/04/03 16:45:50 tgl Exp $
1212
*-------------------------------------------------------------------------
1313
*/
1414
#include"postgres.h"
@@ -173,12 +173,25 @@ decodePageUpdateRecord(PageUpdateRecord *decoded, XLogRecord *record)
173173
staticvoid
174174
gistRedoPageUpdateRecord(XLogRecPtrlsn,XLogRecord*record,boolisnewroot)
175175
{
176+
gistxlogPageUpdate*xldata= (gistxlogPageUpdate*)XLogRecGetData(record);
176177
PageUpdateRecordxlrec;
177178
Relationreln;
178179
Bufferbuffer;
179180
Pagepage;
180181

181-
/* nothing to do if whole page was backed up (and no info to do it with) */
182+
/* we must fix incomplete_inserts list even if XLR_BKP_BLOCK_1 is set */
183+
if (ItemPointerIsValid(&(xldata->key)))
184+
{
185+
if (incomplete_inserts!=NIL)
186+
forgetIncompleteInsert(xldata->node,xldata->key);
187+
188+
if (!isnewroot&&xldata->blkno!=GIST_ROOT_BLKNO)
189+
pushIncompleteInsert(xldata->node,lsn,xldata->key,
190+
&(xldata->blkno),1,
191+
NULL);
192+
}
193+
194+
/* nothing else to do if page was backed up (and no info to do it with) */
182195
if (record->xl_info&XLR_BKP_BLOCK_1)
183196
return;
184197

@@ -237,17 +250,6 @@ gistRedoPageUpdateRecord(XLogRecPtr lsn, XLogRecord *record, bool isnewroot)
237250
PageSetTLI(page,ThisTimeLineID);
238251
MarkBufferDirty(buffer);
239252
UnlockReleaseBuffer(buffer);
240-
241-
if (ItemPointerIsValid(&(xlrec.data->key)))
242-
{
243-
if (incomplete_inserts!=NIL)
244-
forgetIncompleteInsert(xlrec.data->node,xlrec.data->key);
245-
246-
if (!isnewroot&&xlrec.data->blkno!=GIST_ROOT_BLKNO)
247-
pushIncompleteInsert(xlrec.data->node,lsn,xlrec.data->key,
248-
&(xlrec.data->blkno),1,
249-
NULL);
250-
}
251253
}
252254

253255
staticvoid

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp