Re: Defaulting wal_sync_method to fdatasync on Linux for 9.1?

From: Marti Raudsepp <marti(at)juffo(dot)org>
To: Greg Smith <greg(at)2ndquadrant(dot)com>
Cc: Andres Freund <andres(at)anarazel(dot)de>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Defaulting wal_sync_method to fdatasync on Linux for 9.1?
Date: 2010-11-05 21:21:50
Message-ID: AANLkTinEAmKDz7x356bgX=-6x7zpjK3bB0hYAmKvYHB9@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Fri, Nov 5, 2010 at 23:10, Greg Smith <greg(at)2ndquadrant(dot)com> wrote:
>> Not having a real O_DSYNC on linux until recently makes it even more
>> dubious to have it as a default...
>>
>
> If Linux is now defining O_DSYNC

Well, Linux always defined both O_SYNC and O_DSYNC, but they used to
have the same value. The defaults changed due to an unfortunate
heuristic in PostgreSQL, which boils down to:

#if O_DSYNC != O_SYNC
#define DEFAULT_SYNC_METHOD SYNC_METHOD_OPEN_DSYNC
#else
#define DEFAULT_SYNC_METHOD SYNC_METHOD_FDATASYNC

(see src/include/access/xlogdefs.h for details)

In fact, I was wrong in my earlier post. Linux always offered O_DSYNC
behavior. What's new is POSIX-compliant O_SYNC, and the fact that
these flags are now distinguished.

Here's the change in Linux:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6b2f3d1f769be5779b479c37800229d9a4809fc3

Regards,
Marti

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Andres Freund 2010-11-05 21:24:54 Re: Defaulting wal_sync_method to fdatasync on Linux for 9.1?
Previous Message Greg Smith 2010-11-05 21:10:36 Re: Defaulting wal_sync_method to fdatasync on Linux for 9.1?