Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 5890790

Browse files
committed
Rework completion of incomplete inserts. Now it writes
WAL log during inserts.
1 parent 19892fe commit 5890790

File tree

2 files changed

+184
-106
lines changed

2 files changed

+184
-106
lines changed

src/backend/access/gist/gistvacuum.c

Lines changed: 13 additions & 7 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/gistvacuum.c,v 1.21 2006/05/17 16:34:59 teodor Exp $
11+
* $PostgreSQL: pgsql/src/backend/access/gist/gistvacuum.c,v 1.22 2006/05/19 11:10:25 teodor Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -104,19 +104,25 @@ gistDeleteSubtree( GistVacuum *gv, BlockNumber blkno ) {
104104

105105
if (!gv->index->rd_istemp)
106106
{
107-
XLogRecData rdata;
107+
XLogRecData rdata[2];
108108
XLogRecPtr recptr;
109109
gistxlogPageDelete xlrec;
110110

111111
xlrec.node = gv->index->rd_node;
112112
xlrec.blkno = blkno;
113113

114-
rdata.buffer = InvalidBuffer;
115-
rdata.data = (char *) &xlrec;
116-
rdata.len = sizeof(gistxlogPageDelete);
117-
rdata.next = NULL;
114+
rdata[0].buffer = buffer;
115+
rdata[0].buffer_std = true;
116+
rdata[0].data = NULL;
117+
rdata[0].len = 0;
118+
rdata[0].next = &(rdata[1]);
118119

119-
recptr = XLogInsert(RM_GIST_ID, XLOG_GIST_PAGE_DELETE, &rdata);
120+
rdata[1].buffer = InvalidBuffer;
121+
rdata[1].data = (char *) &xlrec;
122+
rdata[1].len = sizeof(gistxlogPageDelete);
123+
rdata[1].next = NULL;
124+
125+
recptr = XLogInsert(RM_GIST_ID, XLOG_GIST_PAGE_DELETE, rdata);
120126
PageSetLSN(page, recptr);
121127
PageSetTLI(page, ThisTimeLineID);
122128
}

0 commit comments

Comments
 (0)