Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 9A0291337BD8 for ; Wed, 16 Mar 2011 16:08:23 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 87531-08 for ; Wed, 16 Mar 2011 19:08:14 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wy0-f174.google.com (mail-wy0-f174.google.com [74.125.82.174]) by mail.postgresql.org (Postfix) with ESMTP id B68A61337990 for ; Wed, 16 Mar 2011 16:08:12 -0300 (ADT) Received: by wya21 with SMTP id 21so1991329wya.19 for ; Wed, 16 Mar 2011 12:08:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=rL6OtifmZeCnqFSBQ05tVASZlVUFi1tTgaoaaKd7SSk=; b=jnK0OmIZbUoIED3naYH7DEVib8dkbRMCuS5rb7YFapCTbcWabWBn4eT4O1WhQrng1a VYKRJWAOjWRMFbvRZ3pjPCfAuTjZyo7qHRe/mswpTuwg+LA2V7LLnO+rB7yPbiei2IWA yvbEU8N4o1WkBdsz7bGy9Q5WWe/gHEeUGbl54= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=a50MbuHgUET0mi/LLRIqGDSUbU4Pp/iUxCSsPHH55TjKs3NGk149btNnRhELrJRXJC aThl0ZV0COMJYI1gRXP5g85XHA/zK6Zq7WQVFa6ZTAnDRQy1+Vkmx63weg1ZKrVIRNtL kU9ZHEzb7j3en1W5QeN8Q+gHsstVQIyDefKgU= Received: by 10.227.177.13 with SMTP id bg13mr355826wbb.92.1300302491745; Wed, 16 Mar 2011 12:08:11 -0700 (PDT) Received: from [192.168.112.20] (22.255.196.88.sta.estpak.ee [88.196.255.22]) by mx.google.com with ESMTPS id w25sm137576wbd.56.2011.03.16.12.08.09 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 16 Mar 2011 12:08:10 -0700 (PDT) Message-ID: <4D810A97.3000602@gmail.com> Date: Wed, 16 Mar 2011 21:08:07 +0200 From: Tambet Matiisen User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.15) Gecko/20110303 Lightning/1.0b2 Thunderbird/3.1.9 MIME-Version: 1.0 To: Kevin Grittner CC: pgsql-bugs@postgresql.org Subject: Re: BUG #5929: ERROR: found toasted toast chunk for toast value 260340218 in pg_toast_260339342 References: <201103150928.p2F9STAd078435@wwwmaster.postgresql.org> <4D7F5FD0020000250003B8E1@gw.wicourts.gov> <4D809A96.6050209@gmail.com> <4D808C70020000250003B98B@gw.wicourts.gov> In-Reply-To: <4D808C70020000250003B98B@gw.wicourts.gov> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.899 tagged_above=-5 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001 X-Spam-Level: X-Archive-Number: 201103/237 X-Sequence-Number: 29747 On 16.03.2011 17:09, Kevin Grittner wrote: > Tambet Matiisen wrote: > >> Pre-live database is restored from live database dump every night. > > How is that done? A single pg_dump of the entire live database > restored using psql? Are both database servers at the same > PostgreSQL version? Yes, I use pg_dump on live server and the result is rdiff-backupped into development server. Whole SQL dump is 12G without compression and the rdiff delta is about 10-20MB every day. Then I drop pre-live database on development server and recreate it using createdb and psql. For a while development server was running 8.4 and live server 8.1. Now both are 8.4, but this shouldn't matter, as I do backup and restore via SQL. > >> So far the errors have been in pre-live database, > > You're running pg_dump against a database you just restored from a > pg_dump image? Hmm, yeah. This sounds rather dumb, but haven't got to that yet. Development server contains some additional databases as well, that do not exist on live server. > >> Usually the next day error was gone. I mostly blamed badly timed >> backup and restore scripts, although this shouldn't result in >> errors. > > No it shouldn't -- if you're following any of the documented backup > and restore techniques. I have a suspicion that you're just doing a > file copy without stopping the live database or properly following > the documented PITR backup and recovery techniques. No, I don't do any advanced backup tricks. Just plain pg_dump and psql. > > This time the error is not in pre-live database and therefore it >> doesn't go away. > > If I understand you, this sounds like corruption in the live > database; nothing on the pre-live database is part of causing this > problem. This would be the case when I do filesystem level copy, but I do not. > >> The server is also running [...] Samba [...] > > I hope you're not trusting Samba too far. For a while we were using > it in backups across our WAN, and it mangled at least one file > almost every day. We had to take to running md5sum against both > ends for each file to ensure we didn't get garbage (until we > converted everything to use TCP communications, which have never > mangled anything for us). As I said, I'm using rdiff-backup to transfer pure SQL files. > >> Both fsync and full_page_writes are on. > > Good. Without those an OS or hardware crash can corrupt your > database. Actually they are commented out, but I suppose this means "on". > >> OK, I don't have UPS for this machine, but power has been stable. >> Current uptime is 32 days, which I bet is from the last kernel >> update. > > OK. A power outage wouldn't be too likely to matter if you have > fsync and full_page_writes on. That's a relief :). > >> Currently I blame either faulty memory or faulty software RAID >> driver. I can easily eliminate the memory cause by running >> memtest86 for few hours > > Is this ECC memory? If not, even a good test doesn't prove that a > RAM problem didn't cause the corruption. It's not ECC memory. > >> Now, off to buy UPS... > > Not a bad idea, but it doesn't sound like lack of that is likely to > have caused the corruption in your live database, based on the > settings you mentioned. (Assuming those settings are in use on the > live server.) Checked live server, it has also fsync=on and full_page_writes=on. But it shouldn't matter, because backup of live server doesn't give any errors. It is possible, that restore of pre-live database using psql lasts so long, that backup of the same database using pg_dump is already kicking in. But again, this shouldn't matter and it doesn't explain why the last error is in another database, that hasn't changed for months. Now I have to find time to run memtest. Tambet