mirror of
https://github.com/postgres/postgres.git
synced 2025-10-24 01:29:19 +03:00
Make CLUSTER MVCC-safe. Heikki Linnakangas
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.218 2007/03/19 23:38:29 wieck Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.219 2007/04/08 01:26:32 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -5857,34 +5857,7 @@ copy_relation_data(Relation rel, SMgrRelation dst)
|
||||
|
||||
/* XLOG stuff */
|
||||
if (use_wal)
|
||||
{
|
||||
xl_heap_newpage xlrec;
|
||||
XLogRecPtr recptr;
|
||||
XLogRecData rdata[2];
|
||||
|
||||
/* NO ELOG(ERROR) from here till newpage op is logged */
|
||||
START_CRIT_SECTION();
|
||||
|
||||
xlrec.node = dst->smgr_rnode;
|
||||
xlrec.blkno = blkno;
|
||||
|
||||
rdata[0].data = (char *) &xlrec;
|
||||
rdata[0].len = SizeOfHeapNewpage;
|
||||
rdata[0].buffer = InvalidBuffer;
|
||||
rdata[0].next = &(rdata[1]);
|
||||
|
||||
rdata[1].data = (char *) page;
|
||||
rdata[1].len = BLCKSZ;
|
||||
rdata[1].buffer = InvalidBuffer;
|
||||
rdata[1].next = NULL;
|
||||
|
||||
recptr = XLogInsert(RM_HEAP_ID, XLOG_HEAP_NEWPAGE, rdata);
|
||||
|
||||
PageSetLSN(page, recptr);
|
||||
PageSetTLI(page, ThisTimeLineID);
|
||||
|
||||
END_CRIT_SECTION();
|
||||
}
|
||||
log_newpage(&dst->smgr_rnode, blkno, page);
|
||||
|
||||
/*
|
||||
* Now write the page. We say isTemp = true even if it's not a temp
|
||||
|
||||
Reference in New Issue
Block a user