Re: O_DIRECT in freebsd - Mailing list pgsql-hackers

From Manfred Spraul
Subject Re: O_DIRECT in freebsd
Date
Msg-id 3F9FFCB4.1020103@colorfullife.com
Whole thread Raw
In response to Re: O_DIRECT in freebsd  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: O_DIRECT in freebsd
List pgsql-hackers
Tom Lane wrote:

> Not for WAL --- we never read the WAL at all in normal operation. (If
>
>it works for writes, then we would want to use it for writing WAL, but
>that's not apparent from what Christopher quoted.)
>
At least under Linux, it works for writes. Oracle uses O_DIRECT to 
access (both read and write) disks that are shared between multiple 
nodes in a cluster - their database kernel must know when the data is 
visible to the other nodes.
One problem for WAL is that O_DIRECT would disable the write cache - 
each operation would block until the data arrived on disk, and that 
might block other backends that try to access WALWriteLock.
Perhaps a dedicated backend that does the writeback could fix that.

Has anyone tried to use posix_fadvise for the wal logs?
http://www.opengroup.org/onlinepubs/007904975/functions/posix_fadvise.html

Linux supports posix_fadvise, it seems to be part of xopen2k.

--   Manfred



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: O_DIRECT in freebsd
Next
From: Bruce Momjian
Date:
Subject: Re: 7.4 compatibility question