Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 21E221337B9A for ; Sun, 7 Nov 2010 19:45:41 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 67520-10 for ; Sun, 7 Nov 2010 23:45:33 +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 553581337B71 for ; Sun, 7 Nov 2010 19:45:33 -0400 (AST) Received: by mail.anarazel.de (Postfix, from userid 108) id 48EB4448006; Mon, 8 Nov 2010 00:45:31 +0100 (CET) Received: from anarazel.de (f053040045.adsl.alicedsl.de [78.53.40.45]) by mail.anarazel.de (Postfix) with ESMTPSA id F2C14448005; Mon, 8 Nov 2010 00:45:23 +0100 (CET) Received: by anarazel.de (Postfix, from userid 1000) id 4C48D1C0109; Mon, 8 Nov 2010 00:45:24 +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 00:45:23 +0100 User-Agent: KMail/1.13.5 (Linux/2.6.37-rc1-andres-00116-g151f52f; KDE/4.5.1; x86_64; ; ) Cc: Marti Raudsepp , pgsql-performance@postgresql.org References: <4CD737C1.9070502@2ndquadrant.com> In-Reply-To: <4CD737C1.9070502@2ndquadrant.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201011080045.23947.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/89 X-Sequence-Number: 41113 On Monday 08 November 2010 00:35:29 Greg Smith wrote: > Marti Raudsepp wrote: > > I will grant you that the details were wrong, but I stand by the > > conclusion. I can state for a fact that PostgreSQL's default > > wal_sync_method varies depending on the header. > > Yes; it's supposed to, and that logic works fine on some other > platforms. The question is exactly what the new Linux O_DSYNC behavior > is doing, in regards to whether it flushes drive caches out or not. > Until you've quantified which of the cases do that--which is required > for reliable operation of PostgreSQL--and which don't, you don't have > any data that can be used to draw a conclusion from. If some setups are > faster because they write less reliably, that doesn't automatically make > them the better choice. I think thats FUD. Sorry. Can you explain to me why fsync() may/should/could be *any* less reliable than O_DSYNC? On *any* platform. Or fdatasync() in the special way its used with pg, namely completely preallocated files. I think the reasons why O_DSYNC is, especially, but not only, in combination with a small wal_buffers setting, slow in most circumstances are pretty clear. Making a setting which is only supported on a small range of systems highest in the preferences list is even more doubtfull than the already strange choice of making O_DSYNC the default given the way it works (i.e. no reordering, synchronous writes in the bgwriter, synchronous writes on wal_buffers pressure etc). Greetings, Andres