Received: from maia.hub.org (unknown [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 76F131336473 for ; Sun, 24 Oct 2010 17:40:39 -0300 (ADT) 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 67120-09 for ; Sun, 24 Oct 2010 20:40:32 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id BD4471337B7F for ; Sun, 24 Oct 2010 17:40:31 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id o9OKeJWU016725; Sun, 24 Oct 2010 16:40:20 -0400 (EDT) To: Greg Smith cc: James Mansion , Kevin Grittner , Bruce Momjian , jd@commandprompt.com, Scott Marlowe , Steve Crawford , pgsql-performance@postgresql.org, Ben Chobot Subject: Re: BBU Cache vs. spindles In-reply-to: <4CC46479.2050206@2ndquadrant.com> References: <4CC04EA50200002500036C5E@gw.wicourts.gov> <201010211935.o9LJZTM21744@momjian.us> <4CC0513E0200002500036C68@gw.wicourts.gov> <4CC3E8BF.4090409@mansionfamily.plus.com> <4CC46479.2050206@2ndquadrant.com> Comments: In-reply-to Greg Smith message dated "Sun, 24 Oct 2010 12:53:13 -0400" Date: Sun, 24 Oct 2010 16:40:19 -0400 Message-ID: <16724.1287952819@sss.pgh.pa.us> From: Tom Lane 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: 201010/394 X-Sequence-Number: 40812 Greg Smith writes: > James Mansion wrote: >> When I looked at the internals of TokyoCabinet for example, the design >> was flawed but >> would be 'fairly robust' so long as mmap'd pages that were dirtied did >> not get persisted >> until msync, and were then persisted atomically. > If TokyoCabinet presumes that's true and overwrites existing blocks with > that assumption, it would land onto my list of databases I wouldn't > trust to hold my TODO list. Flip off power to a server, and you have no > idea what portion of the blocks sitting in the drive's cache actually > made it to disk; that's not even guaranteed atomic to the byte level. The other and probably worse problem is that there's no application control over how soon changes to mmap'd pages get to disk. An msync will flush them out, but the kernel is free to write dirty pages sooner. So if they're depending for consistency on writes not happening until msync, it's broken by design. (This is one of the big reasons we don't use mmap'd space for Postgres disk buffers.) regards, tom lane