"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