Commit 09518fbd authored by Teodor Sigaev's avatar Teodor Sigaev

Call MarkBufferDirty() before XLogInsert() during completion of insert

parent 420cbff8
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/gist/gistxlog.c,v 1.19 2006/05/19 16:15:17 teodor Exp $ * $PostgreSQL: pgsql/src/backend/access/gist/gistxlog.c,v 1.20 2006/05/19 17:15:41 teodor Exp $
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
#include "postgres.h" #include "postgres.h"
...@@ -753,14 +753,16 @@ gistContinueInsert(gistIncompleteInsert *insert) ...@@ -753,14 +753,16 @@ gistContinueInsert(gistIncompleteInsert *insert)
* for following possible replays * for following possible replays
*/ */
/* write pages with XLOG LSN */ /* write pages, we should mark it dirty befor XLogInsert() */
for (j = 0; j < numbuffer; j++) {
GistPageGetOpaque(pages[j])->rightlink = InvalidBlockNumber;
MarkBufferDirty(buffers[j]);
}
recptr = XLogInsert(RM_GIST_ID, XLOG_GIST_PAGE_UPDATE, rdata); recptr = XLogInsert(RM_GIST_ID, XLOG_GIST_PAGE_UPDATE, rdata);
for (j = 0; j < numbuffer; j++) for (j = 0; j < numbuffer; j++)
{ {
PageSetLSN(pages[j], recptr); PageSetLSN(pages[j], recptr);
PageSetTLI(pages[j], ThisTimeLineID); PageSetTLI(pages[j], ThisTimeLineID);
GistPageGetOpaque(pages[j])->rightlink = InvalidBlockNumber;
MarkBufferDirty(buffers[j]);
} }
END_CRIT_SECTION(); END_CRIT_SECTION();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment