Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 6E84E13364DE for ; Fri, 22 Oct 2010 12:37:58 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 48839-02 for ; Fri, 22 Oct 2010 15:37:51 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.17.9]) by mail.postgresql.org (Postfix) with ESMTP id E24521337B77 for ; Fri, 22 Oct 2010 12:37:50 -0300 (ADT) Received: from [192.168.1.6] (static-71-179-240-8.bltmmd.fios.verizon.net [71.179.240.8]) by mrelayeu.kundenserver.de (node=mrbap1) with ESMTP (Nemesis) id 0M5IfX-1OQQUk3ikZ-00zIXv; Fri, 22 Oct 2010 17:37:27 +0200 Message-ID: <4CC1AFB3.3000903@2ndquadrant.com> Date: Fri, 22 Oct 2010 11:37:23 -0400 From: Greg Smith User-Agent: Thunderbird 2.0.0.24 (X11/20100317) MIME-Version: 1.0 To: Tom Lane CC: Kevin Grittner , Bruce Momjian , jd@commandprompt.com, Scott Marlowe , Steve Crawford , pgsql-performance@postgresql.org, Ben Chobot Subject: Re: BBU Cache vs. spindles References: <4CC04EA50200002500036C5E@gw.wicourts.gov> <201010211935.o9LJZTM21744@momjian.us> <4CC0513E0200002500036C68@gw.wicourts.gov> <4CC1094C.1090306@2ndquadrant.com> <13038.1287720327@sss.pgh.pa.us> In-Reply-To: <13038.1287720327@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:Y1109F8nMTX30lW5Tp3ouaadNbbXEEQF/M9UptmMkh/ eMoALfBNfnUHjyslzsQZzqeM8zvHcDlZgaCKDCA/HJtMptPhxr E33iJ6aRHCYe5gf1pU5UDGverv1sHu/bLUYeJsW4eOU/XX10Mz 3XK73h4liQv5YduVMoQO4DO6lVjS4P+5ztRj6ZkGmqlJrCdzDP 5VMpGlG2hqByO6ZV8hdp8/euIQqyGvw/9qTTOkMWnw= X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201010/380 X-Sequence-Number: 40798 Tom Lane wrote: > You've got entirely too simplistic a view of what the "delta" might be, > I fear. In particular there are various sorts of changes that involve > inserting the data carried in the WAL record and shifting pre-existing > data around to make room, or removing an item and moving remaining data > around. If you try to replay that type of action against a torn page, > you'll get corrupted results. > I wasn't sure exactly how those were encoded, thanks for the clarification. Given that, it seems to me there are only two situations where full_page_writes is safe to turn off: 1) The operating system block size is exactly the same database block size, and all writes are guaranteed to be atomic to that block size. 2) You're using a form of journaled filesystem where data blocks are never updated, they're always written elsewhere and the filesystem is redirected to that new block once it's on disk. Looks to me like whether or not there's a non-volatile write cache sitting in the middle, like a BBU protected RAID card, doesn't really make any difference here then. I think that most people who have thought they were safe to turn off full_page_writes in the past did so because they believed they were in category (1) here. I've never advised anyone to do that, because it's so difficult to validate the truth of. Just given that, I'd be tempted to join in on suggesting this parameter just go away in the name of safety, except that I think category (2) here is growing now. ZFS is the most obvious example where the atomic write implementation seems to always make disabling full_page_writes safe. -- Greg Smith 2ndQuadrant US greg@2ndQuadrant.com Baltimore, MD PostgreSQL Training, Services and Support www.2ndQuadrant.us "PostgreSQL 9.0 High Performance": http://www.2ndQuadrant.com/books