Re: O_DIRECT for WAL writes

From: Neil Conway <neilc(at)samurai(dot)com>
To: maryedie(at)osdl(dot)org
Cc: ITAGAKI Takahiro <itagaki(dot)takahiro(at)lab(dot)ntt(dot)co(dot)jp>, pgsql-patches(at)postgresql(dot)org
Subject: Re: O_DIRECT for WAL writes
Date: 2005-06-02 01:39:25
Message-ID: 1117676365.6678.101.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Luke Lonergan 2005-06-02 01:50:23 Re: NOLOGGING option, or ?
Previous Message Bruce Momjian 2005-06-02 01:24:11 Re: [PATCHES] Adding \x escape processing to COPY, psql, backend

Browse pgsql-patches by date

  From Date Subject
Next Message Neil Conway 2005-06-02 01:42:29 Re: COPY fast parse patch
Previous Message Bruce Momjian 2005-06-02 01:24:11 Re: [PATCHES] Adding \x escape processing to COPY, psql, backend