Re: Simplifying wal_sync_method - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Simplifying wal_sync_method
Date
Msg-id 20050809141852.GC19070@alvh.no-ip.org
Whole thread Raw
In response to Re: Simplifying wal_sync_method  ("Magnus Hagander" <mha@sollentuna.net>)
List pgsql-hackers
On Tue, Aug 09, 2005 at 04:05:28PM +0200, Magnus Hagander wrote:
> > > > Now thinking about it, the guy had corrupt table, not WAL log.
> > > > How is WAL->tables synched?  Does the 'wal_sync_method' 
> > > > affect it or not?
> > > 
> > > I *think* it always fsyncs() there as it is now, but I'm 
> > not 100% sure.
> > 
> > No.  If fsync is off, then no fsync is done to the data files 
> > on checkpoint either.  (See mdsync() on src/backend/storage/smgr/md.c)
> 
> Right, but we're not talking fsync=off, we're talking when you are using
> fdatasync, O_SYNC etc. 

Oh, sorry :-)  At that point, pg_fsync is called, which can invoke
commit() or fsync() depending on whether you have writethrough enabled.

pg_fsync() on storage/file/fd.c

-- 
Alvaro Herrera (<alvherre[a]alvh.no-ip.org>)
FOO MANE PADME HUM


pgsql-hackers by date:

Previous
From: "Magnus Hagander"
Date:
Subject: Re: Simplifying wal_sync_method
Next
From: mark@mark.mielke.cc
Date:
Subject: Re: Simplifying wal_sync_method