Re: [pgsql-hackers-win32] Sync vs. fsync during checkpoint - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [pgsql-hackers-win32] Sync vs. fsync during checkpoint
Date
Msg-id 8526.1076862413@sss.pgh.pa.us
Whole thread Raw
In response to Re: [pgsql-hackers-win32] Sync vs. fsync during checkpoint  (Florian Weimer <fw@deneb.enyo.de>)
Responses Re: [pgsql-hackers-win32] Sync vs. fsync during checkpoint  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
Florian Weimer <fw@deneb.enyo.de> writes:
> Tom Lane wrote:
>> You can only fsync one FD at a time (too bad ... if there were a
>> multi-file-fsync API it'd solve the overspecified-write-ordering issue).

> What about aio_fsync()?

(1) it's unportable; (2) it's not clear that it's any improvement over
fsync().  The Single Unix Spec says aio_fsync "returns when the
synchronisation request has been initiated or queued to the file or
device".  Depending on how the implementation works, this may mean that
all the dirty blocks have been scheduled for I/O and will be written
ahead of subsequently scheduled blocks --- if so, the results are not
really different from fsync()'ing the files in the same order.

The best idea I've heard so far is the one about sync() followed by
a bunch of fsync()s.  That seems to be correct, efficient, and dependent
only on very-long-established Unix semantics.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: [PATCHES] dollar quoting
Next
From: Stephan Szabo
Date:
Subject: Re: [SQL] 7.4 - FK constraint performance