Skip to content

Commit 09518fb

Browse files
committed
Call MarkBufferDirty() before XLogInsert() during completion of insert
1 parent 420cbff commit 09518fb

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/backend/access/gist/gistxlog.c

Lines changed: 6 additions & 4 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.19 2006/05/19 16:15:17 teodor Exp $
11+
* $PostgreSQL: pgsql/src/backend/access/gist/gistxlog.c,v 1.20 2006/05/19 17:15:41 teodor Exp $
1212
*-------------------------------------------------------------------------
1313
*/
1414
#include "postgres.h"
@@ -753,14 +753,16 @@ gistContinueInsert(gistIncompleteInsert *insert)
753753
* for following possible replays
754754
*/
755755

756-
/* write pages with XLOG LSN */
756+
/* write pages, we should mark it dirty befor XLogInsert() */
757+
for (j = 0; j < numbuffer; j++) {
758+
GistPageGetOpaque(pages[j])->rightlink = InvalidBlockNumber;
759+
MarkBufferDirty(buffers[j]);
760+
}
757761
recptr = XLogInsert(RM_GIST_ID, XLOG_GIST_PAGE_UPDATE, rdata);
758762
for (j = 0; j < numbuffer; j++)
759763
{
760764
PageSetLSN(pages[j], recptr);
761765
PageSetTLI(pages[j], ThisTimeLineID);
762-
GistPageGetOpaque(pages[j])->rightlink = InvalidBlockNumber;
763-
MarkBufferDirty(buffers[j]);
764766
}
765767

766768
END_CRIT_SECTION();

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy