Re: Defaulting wal_sync_method to fdatasync on Linux for 9.1?

From: Andres Freund <andres(at)anarazel(dot)de>
To: Greg Smith <greg(at)2ndquadrant(dot)com>
Cc: Scott Carey <scott(at)richrelevance(dot)com>, Marti Raudsepp <marti(at)juffo(dot)org>, "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Defaulting wal_sync_method to fdatasync on Linux for 9.1?
Date: 2010-11-08 22:32:10
Message-ID: 201011082332.11236.andres@anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Hi,

On Monday 08 November 2010 23:12:57 Greg Smith wrote:
> This seems to be ignoring the fact that unless you either added a
> non-volatile cache or specifically turned off all write caching on your
> drives, the results of all power-fail testing done on earlier versions
> of Linux was that it failed. The default configuration of PostgreSQL on
> Linux has been that any user who has a simple SATA drive gets unsafe
> writes, unless they go out of their way to prevent them.
Which is about *no* argument in favor of any of the options, right?

> Whatever newer kernels do by default cannot be worse. The open question
> is whether it's still broken, in which case we might as well favor the
> known buggy behavior rather than the new one, or whether everything has
> improved enough to no longer be unsafe with the new defaults.
Either I majorly misunderstand you, or ... I dont know.

There simply *is* no new implementation relevant for this discussion. Full
Stop. What changed is that O_DSYNC is defined differently from O_SYNC these days
and O_SYNC actually does what it should. Which causes pg to move open_datasync
first in the preference list doing what the option with the lowest preference
did up to now.

That does not *at all* change the earlier fdatasync() or fsync()
implementations/tests. It simply makes open_datasync the default doing what
open_sync did earlier.
For that note that open_sync was the method of *least* preference till now...
And that fdatasync() thus was the default till now. Which it is not anymore.

I don't argue *at all* that we have to test the change moving fdatasync before
open_datasync on the *other* operating systems. What I completely don't get is
all that talking about data consistency on linux. Its simply irrelevant in
that context.

Andres

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Till Kirchner 2010-11-09 10:39:48 out of memory problem
Previous Message Greg Smith 2010-11-08 22:12:57 Re: Defaulting wal_sync_method to fdatasync on Linux for 9.1?