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 B1F33D9DFD for ; Thu, 10 Nov 2005 12:39:37 -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 68950-09 for ; Thu, 10 Nov 2005 16:39:36 +0000 (GMT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 35C00D8FC5 for ; Thu, 10 Nov 2005 12:39:36 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id jAAGdYFW009792; Thu, 10 Nov 2005 11:39:34 -0500 (EST) To: Scott Marlowe Cc: Michael Stone , pgsql-performance@postgresql.org Subject: Re: WAL sync behaviour In-reply-to: <1131637958.3554.75.camel@state.g2switchworks.com> References: <20051110133241.GA4031@uio.no> <437355C6.4030604@archonet.com> <20051110142535.GA4530@uio.no> <20051110144309.GO9905@mathom.us> <1131637958.3554.75.camel@state.g2switchworks.com> Comments: In-reply-to Scott Marlowe message dated "Thu, 10 Nov 2005 09:52:38 -0600" Date: Thu, 10 Nov 2005 11:39:34 -0500 Message-ID: <9791.1131640774@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.006 required=5 tests=[AWL=0.006] X-Spam-Score: 0.006 X-Spam-Level: X-Archive-Number: 200511/185 X-Sequence-Number: 15442 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. regards, tom lane