Re: Disable WAL backup pages when fsync is off

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Russell Smith <russell(at)pws(dot)com(dot)au>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Disable WAL backup pages when fsync is off
Date: 2005-07-04 01:57:01
Message-ID: 200507040157.j641v1w21603@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Russell Smith wrote:
> On Sun, 3 Jul 2005 03:51 pm, Tom Lane wrote:
> > Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > > The following patch disables WAL backup pages when fsync is off.
> >
> > This is a good idea why?
> >
> If it is, why do we write wal at all if fsync is off?

Good question. WAL is to recover the file system files in case of a
crash. WAL is used in cases where PostgreSQL crashes, but the operating
system is still running. WAL brings the file system files back to a
consistent state containing all completed transactions.

fsync() is for forcing the data to disk so an operating system crash is
recoverable. If that isn't happening, the cleanup of partial page
writes is hardly important because the system is not consistent.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2005-07-04 02:02:07 Re: contrib/pgcrypto patch for OpenSSL 0.9.8
Previous Message Bruce Momjian 2005-07-04 01:53:00 Re: Disable WAL backup pages when fsync is off