X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 7292D52870 for ; Tue, 16 Aug 2005 20:15:06 -0300 (ADT) 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 36806-02 for ; Tue, 16 Aug 2005 23:15:00 +0000 (GMT) Received: from sccmmhc91.asp.att.net (sccmmhc91.asp.att.net [204.127.203.211]) by svr1.postgresql.org (Postfix) with ESMTP id 2E235529E6 for ; Tue, 16 Aug 2005 20:14:58 -0300 (ADT) Received: from juju.arbash-meinel.com ([12.214.18.81]) by sccmmhc91.asp.att.net (sccmmhc91) with ESMTP id <20050816231500m9100g6eeae>; Tue, 16 Aug 2005 23:15:00 +0000 Received: by juju.arbash-meinel.com (Postfix, from userid 505) id C048155FBA; Tue, 16 Aug 2005 18:14:59 -0500 (CDT) Received: from [192.168.1.119] (71-32-69-23.cdrr.qwest.net [71.32.69.23]) by juju.arbash-meinel.com (Postfix) with ESMTP id 46D3755FAD; Tue, 16 Aug 2005 18:14:45 -0500 (CDT) Message-ID: <43027361.2070303@arbash-meinel.com> Date: Tue, 16 Aug 2005 18:14:41 -0500 From: John A Meinel User-Agent: Mozilla Thunderbird 1.0.6 (Macintosh/20050716) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tom Lane , Postgresql Performance Subject: Re: PG8 Tuning References: <1536.217.45.209.171.1123763001.squirrel@www.gradwell.com> <1123836428.19976.26.camel@amd64-laptop-spoe> <1123779524.6664.1.camel@toonses.gghcwest.com> <200508160912.32263.josh@agliodbs.com> <20050816162531.GB32695@alvh.no-ip.org> <43021567.1000101@arbash-meinel.com> <7516.1124232599@sss.pgh.pa.us> In-Reply-To: <7516.1124232599@sss.pgh.pa.us> X-Enigmail-Version: 0.92.0.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig5E2D1FE484D3F3971760F402" X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.038 required=5 tests=[AWL=-0.013, FORGED_RCVD_HELO=0.05] X-Spam-Level: X-Archive-Number: 200508/191 X-Sequence-Number: 13938 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig5E2D1FE484D3F3971760F402 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Tom Lane wrote: > John A Meinel writes: > >>Alvaro Herrera wrote: >> >>>I've been asked this a couple of times and I don't know the answer: what >>>happens if you give XLog a single drive (unmirrored single spindle), and >>>that drive dies? So the question really is, should you be giving two >>>disks to XLog? > > >>I can propose a simple test. Create a test database. Run postgres, >>insert a bunch of stuff. Stop postgres. Delete everything in the pg_xlog >>directory. Start postgres again, what does it do? > > > That test would really be completely unrelated to the problem. > > If you are able to shut down the database cleanly, then you do not need > pg_xlog anymore --- everything is on disk in the data area. You might > have to use pg_resetxlog to get going again, but you won't lose anything > by doing so. So pg_xlog is really only needed for a dirty shutdown. So what about the idea of having pg_xlog on a ramdisk that is syncronized periodically to a real disk. I'm guessing you would get corruption of the database, or at least you don't know what is clean and what is dirty, since there would be no WAL entry for some of the things that completed, but also no WAL entry for things that were not completed. So what is actually written to the WAL? Is it something like: "I am writing these pages, and when page X has a certain value, I am finished" I'm just curious, because I don't believe you write to the WAL when you complete the writing the data, you only make a note about what you are going to do before you do it. So there needs to be a way to detect if you actually finished (which would be in the actual data). John =:-> > > The question of importance is: if the xlog drive dies while the database > is running, are you going to be able to get the postmaster to shut down > cleanly? My suspicion is "no" --- if the kernel is reporting write > failures on WAL, that's going to prevent writes to the data drives (good > ol' WAL-before-data rule). You could imagine failure modes where the > drive is toast but isn't actually reporting any errors ... but one hopes > that's not a common scenario. > > In a scenario like this, it might be interesting to have a shutdown mode > that deliberately ignores writing to WAL and just does its best to get > all the dirty pages down onto the data drives. > > In the meantime ... use a mirrored drive for WAL. > > regards, tom lane > --------------enig5E2D1FE484D3F3971760F402 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (Darwin) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFDAnNkJdeBCYSNAAMRAvbYAJ4oWsYrHLDMpZwN54Hj0iar6SSsGACgx59f 9DeX5ViF+I9WodBxGD3/4lw= =MeG4 -----END PGP SIGNATURE----- --------------enig5E2D1FE484D3F3971760F402--