X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 6EC84DB159 for ; Thu, 10 Nov 2005 13:00:13 -0400 (AST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 95615-06 for ; Thu, 10 Nov 2005 17:00:12 +0000 (GMT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from koolancexeon.g2switchworks.com (mail.g2switchworks.com [63.87.162.25]) by svr1.postgresql.org (Postfix) with ESMTP id 4F320DB129 for ; Thu, 10 Nov 2005 13:00:10 -0400 (AST) Received: mail.g2switchworks.com 10.10.1.8 from 10.10.1.37 10.10.1.37 via HTTP with MS-WebStorage 6.5.6944 Received: from state.g2switchworks.com by mail.g2switchworks.com; 10 Nov 2005 11:00:10 -0600 Subject: Re: WAL sync behaviour From: Scott Marlowe To: Tom Lane Cc: Michael Stone , pgsql-performance@postgresql.org In-Reply-To: <9791.1131640774@sss.pgh.pa.us> References: <20051110133241.GA4031@uio.no> <437355C6.4030604@archonet.com> <20051110142535.GA4530@uio.no> <20051110144309.GO9905@mathom.us> <1131637958.3554.75.camel@state.g2switchworks.com> <9791.1131640774@sss.pgh.pa.us> Content-Type: text/plain Content-Transfer-Encoding: 7bit Message-Id: <1131642009.3554.87.camel@state.g2switchworks.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) Date: Thu, 10 Nov 2005 11:00:10 -0600 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.007 required=5 tests=[AWL=0.006, UNPARSEABLE_RELAY=0.001] X-Spam-Score: 0.007 X-Spam-Level: X-Archive-Number: 200511/188 X-Sequence-Number: 15445 On Thu, 2005-11-10 at 10:39, Tom Lane wrote: > Scott Marlowe writes: > > On Thu, 2005-11-10 at 08:43, Michael Stone wrote: > >> There's no reason to use a journaled filesystem for the wal. Use ext2 in > >> preference to ext3. > > > Not from what I understood. Ext2 can't guarantee that your data will > > even be there in any form after a crash. I believe only metadata > > journaling is needed though. > > No, Mike is right: for WAL you shouldn't need any journaling. This is > because we zero out *and fsync* an entire WAL file before we ever > consider putting live WAL data in it. During live use of a WAL file, > its metadata is not changing. As long as the filesystem follows > the minimal rule of syncing metadata about a file when it fsyncs the > file, all the live WAL files should survive crashes OK. > > We can afford to do this mainly because WAL files can normally be > recycled instead of created afresh, so the zero-out overhead doesn't > get paid during normal operation. > > You do need metadata journaling for all non-WAL PG files, since we don't > fsync them every time we extend them; which means the filesystem could > lose track of which disk blocks belong to such a file, if it's not > journaled. Thanks for the clarification! Nice to know I can setup an ext2 partition for my WAL files then. Is this in the docs anywhere?