Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 2D44B1337B87 for ; Mon, 8 Nov 2010 18:32:22 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 76266-04 for ; Mon, 8 Nov 2010 22:32:16 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.anarazel.de (mail.anarazel.de [217.115.131.40]) by mail.postgresql.org (Postfix) with ESMTP id B11F21337B68 for ; Mon, 8 Nov 2010 18:32:14 -0400 (AST) Received: from alap2.localnet (p579FAA46.dip.t-dialin.net [87.159.170.70]) by mail.anarazel.de (Postfix) with ESMTPSA id F2D6B448005; Mon, 8 Nov 2010 23:32:12 +0100 (CET) From: Andres Freund To: Greg Smith Subject: Re: Defaulting wal_sync_method to fdatasync on Linux for 9.1? Date: Mon, 8 Nov 2010 23:32:10 +0100 User-Agent: KMail/1.13.5 (Linux/2.6.36-rc6-andres-00006-g4193d91; KDE/4.5.1; x86_64; ; ) Cc: Scott Carey , Marti Raudsepp , "pgsql-performance@postgresql.org" References: <9D7DB2F2-683B-480C-B781-8D282A280E35@richrelevance.com> <4CD875E9.30207@2ndquadrant.com> In-Reply-To: <4CD875E9.30207@2ndquadrant.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201011082332.11236.andres@anarazel.de> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201011/114 X-Sequence-Number: 41138 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