X-Original-To: pgsql-performance-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id A919B9FB1FB for ; Tue, 15 Aug 2006 16:15:19 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 10794-05 for ; Tue, 15 Aug 2006 19:15:09 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from noel.decibel.org (noel.decibel.org [67.100.216.10]) by postgresql.org (Postfix) with ESMTP id 5B5929FB1F1 for ; Tue, 15 Aug 2006 16:15:08 -0300 (ADT) Received: by noel.decibel.org (Postfix, from userid 1001) id 2D3455644D; Tue, 15 Aug 2006 14:15:07 -0500 (CDT) Received: (hashcash-sendmail, from uid 1001); Tue, 15 Aug 2006 14:15:05 -0500 Date: Tue, 15 Aug 2006 14:15:05 -0500 From: "Jim C. Nasby" To: mark@mark.mielke.cc, pgsql-performance@postgresql.org Subject: Re: Postgresql Performance on an HP DL385 and Message-ID: <20060815191505.GH21363@pervasive.com> References: <1155180553.13315.0.camel@amd64-gentoo-laptop> <20060810110935.GF2900@mathom.us> <20060814153841.GF27928@pervasive.com> <721b21dc0608140851v2332cdf9g59808004c983540f@mail.gmail.com> <20060814170545.GG27928@pervasive.com> <20060814170902.GN2900@mathom.us> <20060815162926.GS27928@pervasive.com> <20060815172645.GU2900@mathom.us> <20060815183327.GC12834@mark.mielke.cc> <20060815190254.GW2900@mathom.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060815190254.GW2900@mathom.us> X-Operating-System: FreeBSD 6.0-RELEASE-p4 amd64 X-Distributed: Join the Effort! http://www.distributed.net User-Agent: Mutt/1.5.11 X-Hashcash: 1:20:060815:mark@mark.mielke.cc::HvNrJs2bfPdmX7so:000000000000000000 00000000000000000000000094m9 X-Hashcash: 1:20:060815:pgsql-performance@postgresql.org::hUCdjPD4hj+ke8/M:00000 0000000000000000000000007hhc X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200608/239 X-Sequence-Number: 20424 On Tue, Aug 15, 2006 at 03:02:56PM -0400, Michael Stone wrote: > On Tue, Aug 15, 2006 at 02:33:27PM -0400, mark@mark.mielke.cc wrote: > >On Tue, Aug 15, 2006 at 01:26:46PM -0400, Michael Stone wrote: > >>On Tue, Aug 15, 2006 at 11:29:26AM -0500, Jim C. Nasby wrote: > >>>Are 'we' sure that such a setup can't lose any data? > >>Yes. If you check the archives, you can even find the last time this was > >>discussed... > > > >I looked last night (coincidence actually) and didn't find proof that > >you cannot lose data. > > You aren't going to find proof, any more than you'll find proof that you > won't lose data if you do lose a journalling fs. (Because there isn't > any.) Unfortunately, many people misunderstand the what a metadata > journal does for you, and overstate its importance in this type of > application. > > >How do you deal with the file system structure being updated before the > >data blocks are (re-)written? > > *That's what the postgres log is for.* If the latest xlog entries don't > make it to disk, they won't be replayed; if they didn't make it to > disk, the transaction would not have been reported as commited. An > application that understands filesystem semantics can guarantee data > integrity without metadata journaling. So what causes files to get 'lost' and get stuck in lost+found? AFAIK that's because the file was written before the metadata. Now, if fsync'ing a file also ensures that all the metadata is written, then we're probably fine... if not, then we're at risk every time we create a new file (every WAL segment if archiving is on, and every time a relation passes a 1GB boundary). FWIW, the way that FreeBSD gets around the need to fsck a dirty filesystem before use without using a journal is to ensure that metadate operations are always on the drive before the actual data is written. There's still a need to fsck a dirty filesystem, but it can now be done in the background, with the filesystem mounted and in use. > >>The bottom line is that the only reason you need a metadata journalling > >>filesystem is to save the fsck time when you come up. On a little > >>partition like xlog, that's not an issue. > > > >fsck isn't only about time to fix. fsck is needed, because the file system > >is broken. > > fsck is needed to reconcile the metadata with the on-disk allocations. > To do that, it reads all the inodes and their corresponding directory > entries. The time to do that is proportional to the size of the > filesystem, hence the comment about time. fsck is not needed "because > the filesystem is broken", it's needed because the filesystem is marked > dirty. > > Mike Stone > > ---------------------------(end of broadcast)--------------------------- > TIP 5: don't forget to increase your free space map settings > -- Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com Pervasive Software http://pervasive.com work: 512-231-6117 vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461