> The reason I'm inclined to question this is that what we want 
> is not an fsync per write but an fsync per transaction, and we can't 
> easily buffer all of a transaction's XLOG writes...

WAL keeps records in WAL buffers (wal-buffers parameter may be used to
increase # of buffers), so we can make write()-s buffered.

Seems that my Solaris has fdatasync, so I'll test different approaches...

Vadim

Fri, 9 Mar 2001 12:08:54 -0800 
"Mikheev, Vadim" <vmikheev@SECTORBASE.COM>
RE: AW: AW: WAL does not recover gracefully from out-of -dis k-sp ace 
"Mikheev, Vadim" <vmikheev@SECTORBASE.COM> writes:
> Seems that my Solaris has fdatasync, so I'll test different approaches...

A Sun guy told me that Solaris does this just the same way that HPUX
does it: fsync() scans all kernel buffers for the file, but O_SYNC
doesn't, because it knows it only needs to sync the blocks covered
by the write().  He didn't say about fdatasync/O_DSYNC but I bet the
same difference exists for those two.

The Linux 2.4 kernel allegedly is set up so that fsync() is smart enough
to only look at dirty buffers, not all the buffers of the file.  So
the performance tradeoffs would be different there.  But on HPUX and
probably Solaris, O_DSYNC is likely to be a big win, unless we can find
a way to stop the kernel from buffering so much of the WAL files.

			regards, tom lane

Fri, 09 Mar 2001 15:17:05 -0500
Tom Lane <tgl@sss.pgh.pa.us>
Re: AW: AW: WAL does not recover gracefully from out-of -dis k-sp ace