Commit d7207cfc authored by Tom Lane's avatar Tom Lane

Even though I'd like to see full_page_writes go away before 8.1,

a minimum requirement is that it not completely break the system
meanwhile.  Put the test in the right place.
parent a4ffa382
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.207 2005/07/05 23:18:09 momjian Exp $ * $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.208 2005/07/08 04:07:26 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -595,9 +595,7 @@ begin:; ...@@ -595,9 +595,7 @@ begin:;
{ {
/* OK, put it in this slot */ /* OK, put it in this slot */
dtbuf[i] = rdt->buffer; dtbuf[i] = rdt->buffer;
/* If fsync is off, no need to backup pages. */ if (XLogCheckBuffer(rdt, &(dtbuf_lsn[i]), &(dtbuf_xlg[i])))
if (fullPageWrites &&
XLogCheckBuffer(rdt, &(dtbuf_lsn[i]), &(dtbuf_xlg[i])))
{ {
dtbuf_bkp[i] = true; dtbuf_bkp[i] = true;
rdt->data = NULL; rdt->data = NULL;
...@@ -947,7 +945,8 @@ XLogCheckBuffer(XLogRecData *rdata, ...@@ -947,7 +945,8 @@ XLogCheckBuffer(XLogRecData *rdata,
*/ */
*lsn = page->pd_lsn; *lsn = page->pd_lsn;
if (XLByteLE(page->pd_lsn, RedoRecPtr)) if (fullPageWrites &&
XLByteLE(page->pd_lsn, RedoRecPtr))
{ {
/* /*
* The page needs to be backed up, so set up *bkpb * The page needs to be backed up, so set up *bkpb
......
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