Re: O_DIRECT for WAL writes - Mailing list pgsql-patches

From Neil Conway
Subject Re: O_DIRECT for WAL writes
Date
Msg-id 1117676365.6678.101.camel@localhost.localdomain
Whole thread Raw
In response to Re: O_DIRECT for WAL writes  (Mary Edie Meredith <maryedie@osdl.org>)
Responses Re: O_DIRECT for WAL writes  (Mary Edie Meredith <maryedie@osdl.org>)
List pgsql-patches
On Wed, 2005-06-01 at 17:08 -0700, Mary Edie Meredith wrote:
> I know I'm late to this discussion, and I haven't made it all the way
> through this thread to see if your questions on Linux writes were
> resolved.   If you are still interested, I recommend read a very good
> one page description of reliable writes buried in the Data Center Linux
> Goals and Capabilities document.

This suggests that on Linux a write() on a file opened with O_DIRECT has
the same synchronization guarantees as a write() on a file opened with
O_SYNC, which is precisely the opposite of what was concluded down
thread. So now I'm more confused :)

(Regardless of behavior on Linux, I would guess O_DIRECT doesn't behave
this way on all platforms -- for example, FreeBSD's open(2) manpage does
not mention I/O synchronization when referring to O_DIRECT. So even if
we can skip the fsync() with O_DIRECT on Linux, I doubt we'll be able to
do that on all platforms.)

-Neil



pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: COPY fast parse patch
Next
From: Neil Conway
Date:
Subject: Re: COPY fast parse patch