Disable WAL backup pages when fsync is off - Mailing list pgsql-patches

From Bruce Momjian
Subject Disable WAL backup pages when fsync is off
Date
Msg-id 200507030301.j6331NP27740@candle.pha.pa.us
Whole thread Raw
Responses Re: Disable WAL backup pages when fsync is off
List pgsql-patches
The following patch disables WAL backup pages when fsync is off.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
Index: src/backend/access/transam/xlog.c
===================================================================
RCS file: /cvsroot/pgsql/src/backend/access/transam/xlog.c,v
retrieving revision 1.205
diff -c -c -r1.205 xlog.c
*** src/backend/access/transam/xlog.c    30 Jun 2005 00:00:50 -0000    1.205
--- src/backend/access/transam/xlog.c    3 Jul 2005 02:52:57 -0000
***************
*** 593,599 ****
                  {
                      /* OK, put it in this slot */
                      dtbuf[i] = rdt->buffer;
!                     if (XLogCheckBuffer(rdt, &(dtbuf_lsn[i]), &(dtbuf_xlg[i])))
                      {
                          dtbuf_bkp[i] = true;
                          rdt->data = NULL;
--- 593,601 ----
                  {
                      /* OK, put it in this slot */
                      dtbuf[i] = rdt->buffer;
!                     /* If fsync is off, no need to backup pages. */
!                     if (enableFsync &&
!                         XLogCheckBuffer(rdt, &(dtbuf_lsn[i]), &(dtbuf_xlg[i])))
                      {
                          dtbuf_bkp[i] = true;
                          rdt->data = NULL;

pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Implementing SELECT FOR UPDATE [NOWAIT]
Next
From: Bruce Momjian
Date:
Subject: Re: enable/disable trigger (Re: Fwd: [HACKERS] Open items)