Re: sync() - Mailing list pgsql-hackers

From Kevin Brown
Subject Re: sync()
Date
Msg-id 20030201161517.GN12957@filer
Whole thread Raw
In response to Re: sync()  (Kurt Roeckx <Q@ping.be>)
Responses Re: sync()
List pgsql-hackers
Kurt Roeckx wrote:
>      [SIO] [Option Start] If _POSIX_SYNCHRONIZED_IO is defined, the
>      fsync() function shall force all currently queued I/O operations
>      associated with the file indicated by file descriptor fildes to the
>      synchronized I/O completion state. All I/O operations shall be
>      completed as defined for synchronized I/O file integrity
>      completion. [Option End]

Hmmm....so if I consistently want these semantics out of fsync() I
have to #define _POSIX_SYNCHRONIZED_IO?  Or does the above mean that
you'll get those semantics if and only if the OS defines the above for
you?

I certainly hope the former is the case, because the newer semantics
which you mentioned in the section I cut don't do us any good at all
and we can't rely on the OS to define something like
_POSIX_SYNCHRONIZED_IO for us...

Being able to open a file, do an fsync(), and have the kernel actually
write all the buffers associated with that file to disk could be, I
think, a significant performance win compared with the "flush
everything known to the kernel" approach we take now, at least on
systems that do something other than PostgreSQL...



-- 
Kevin Brown                          kevin@sysexperts.com


pgsql-hackers by date:

Previous
From: "Andrew Dunstan"
Date:
Subject: Re: [mail] Re: Windows Build System
Next
From: Tom Lane
Date:
Subject: pg_dump is broken by recent privileges changes