Re: Allowing WAL fsync to be done via O_SYNC - Mailing list pgsql-hackers

From Alfred Perlstein
Subject Re: Allowing WAL fsync to be done via O_SYNC
Date
Msg-id 20010315145100.E29888@fw.wintelcom.net
Whole thread Raw
In response to RE: Allowing WAL fsync to be done via O_SYNC  ("Mikheev, Vadim" <vmikheev@SECTORBASE.COM>)
Responses Re: Allowing WAL fsync to be done via O_SYNC  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
* Mikheev, Vadim <vmikheev@SECTORBASE.COM> [010315 13:52] wrote:
> > I believe that we don't know enough yet to nail down a hard-wired
> > decision.  Vadim's idea of preferring O_DSYNC if it appears to be
> > different from O_SYNC is a good first cut, but I think we'd 
> > better make it possible to override that, at least for testing purposes.
> 
> So let's leave fsync as default and add option to open log files
> with O_DSYNC/O_SYNC.

I have a weird and untested suggestion:

How many files need to be fsync'd?

If it's more than one, what might work is using mmap() to map the
files in adjacent areas, then calling msync() on the entire range,
this would allow you to batch fsync the data.

The only problem is that I'm not sure:

1) how portable msync() is.
2) if msync garauntees metadata consistancy.

Another benifit of mmap() is the 'zero' copy nature of it.

-- 
-Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org]



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Allowing WAL fsync to be done via O_SYNC
Next
From: Tom Lane
Date:
Subject: Re: Allowing WAL fsync to be done via O_SYNC