Re: We really ought to do something about O_DIRECT and data=journalled on ext4 - Mailing list pgsql-hackers

From Marti Raudsepp
Subject Re: We really ought to do something about O_DIRECT and data=journalled on ext4
Date
Msg-id AANLkTin4vUCB9Ssb6Ywi80_fHR8dLPz=PqsS72aEjp05@mail.gmail.com
Whole thread Raw
In response to Re: We really ought to do something about O_DIRECT and data=journalled on ext4  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: We really ought to do something about O_DIRECT and data=journalled on ext4
List pgsql-hackers
On Tue, Dec 7, 2010 at 03:34, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> To my mind, O_DIRECT is not really the key issue here, it's whether to
> prefer O_DSYNC or fdatasync.

Since different platforms implement these primitives differently, and
it's not always clear from the header file definitions which options
are actually implemented, how about simply hard-coding a default value
for each platform?

1. This would be quite straightforward to code and document (a table
of platforms and their default wal_sync_method setting)

2. The best performing (or safest) method can be chosen on every
platform. From the above discussion it seems that Windows and OSX
should default to fdatasync_writethrough even if other methods are
available

3. It would pre-empt similar surprises if other platforms change their
header files, like what happened on Linux now.

Sounds like the simple and foolproof solution.

Regards,
Marti


pgsql-hackers by date:

Previous
From: Oleg Bartunov
Date:
Subject: plperlu problem with utf8
Next
From: Merlin Moncure
Date:
Subject: Re: Solving sudoku using SQL