Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 48E2C633ED9 for ; Sat, 21 Feb 2009 05:40:53 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 92499-06 for ; Sat, 21 Feb 2009 05:40:46 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-gx0-f176.google.com (mail-gx0-f176.google.com [209.85.217.176]) by mail.postgresql.org (Postfix) with ESMTP id 665D863325B for ; Sat, 21 Feb 2009 05:40:45 -0400 (AST) Received: by gxk24 with SMTP id 24so4434762gxk.19 for ; Sat, 21 Feb 2009 01:40:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=P1V36llbMbgPxNMsMNra1LK3ZMnSlfWxwXiKbgvn7Hw=; b=hV+C8TqRLXFL/wBbPCIVO5vj8dBcQrKfrzsrWNDyaAfIJG770V3cZThhpTvaxk7M1d nGDX/scVOBvVDupka90DKiR+iEqKwp4sUCo01UA90H8ZOwWeTwpK3K5LkXNs7nzqTKiC KLhh+1Vbfy/CAizpcmjkl9+7KQ2e+CkOz+Fs8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=X9sO2ZwJSj/9GVxTtOG/pXN3oMh3EoB6wbmhzC9bw2YCqTYX3iw5/wNXiDep3FqP1n aDDpAyTipT7o/1M9jKVJ7mOb7wkPBoqe7S9sulYGC7DtfdK0/vN66dAJAVR+ilofWjiG hO/DnDu2MGp+jYjGUobDkjgHo2vHHJMOCCrXA= MIME-Version: 1.0 Received: by 10.151.14.5 with SMTP id r5mr2569780ybi.135.1235209243373; Sat, 21 Feb 2009 01:40:43 -0800 (PST) In-Reply-To: <200902210943.27875@zmi.at> References: <43a3a0bccd3684972f33e0051b45f2b4@webmail.zmi.at> <200902210943.27875@zmi.at> Date: Sat, 21 Feb 2009 02:40:43 -0700 Message-ID: Subject: Re: 8.3.5 broken after power fail SOLVED From: Scott Marlowe To: Michael Monnerie Cc: pgsql-admin@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200902/167 X-Sequence-Number: 31388 On Sat, Feb 21, 2009 at 1:43 AM, Michael Monnerie wrote: > I managed to recover the data that was still readable. About 650 > messageblock entries got lost. What makes me nervous a bit is that > postgres kept running despite (partially) being destroyed. It should > really have shutdown itself after the first problem was found. That > database is for mails, and I would understand to have lost some from the > time before the power loss, but I even lost entries from *after* the > crash. That means the error happened after the system was up again and > happily did it's work, but lost entries to a table. Could there be a > better way to check the db at crash recovery startup time? > > If someone is interested, I have a full postgres log with every single > command done to the database. We preach this again and again. PostgreSQL can only survive a power outage type failure ONLY if the hardware / OS / filesystem don't lie about fsync. If they do, all bets are off, and this kind of failure means you should really failover to another machine or restore a backup. It's why you have to do possibly destructive tests to see if your server stands at least some chance of surviving this kind of failure, log shipping for recovery, and / or replication of another form (slony etc...) to have a reliable server. The recommendations for recovery of data are just that, recovery oriented. They can't fix a broken database at that point. You need to take it offline after this kind of failure if you can't trust your hardware. Usually when it finds something wrong it just won't start up.