Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id DFEF61337BB4 for ; Wed, 16 Mar 2011 08:10:25 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 35378-04 for ; Wed, 16 Mar 2011 11:10:18 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mail.postgresql.org (Postfix) with ESMTP id 95CC3133616B for ; Wed, 16 Mar 2011 08:10:17 -0300 (ADT) Received: by wwc33 with SMTP id 33so1966467wwc.19 for ; Wed, 16 Mar 2011 04:10:17 -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=cigfFsxR3U6rCZ5xt+9tjHH7zh8U/yv5TQhD9t1c5NU=; b=KOEw6J4+j9O81qn9UXMQaOwC+cbOa0tR/Pt7SNZ6HOy9E635Yvctm1VXcjtNEp+CnL n9JyQMs6QDx7JL/LbgVsEpBtArY6Ro7nSfOaTnsIog9JFfNbFA6wodmd9oNM2VaFCQBV sGg5YHC3CirJcUycVHLP6oGIOwkgH7nD4G1I8= 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=GTS+Ft6m1PyuM9WZkpOnndsrkd3kkUvuTOTQom1chX4+/6pB9vA3ByXYjliqMn0uYf x2cB4eJjYJSxwenmhpzRl+DOV3rpx46uEPrelHvZPXmzygL5OdCGjfva25Dzxq5da1wc +e/84x7I53dyj9yZZYHbwNfMfSpHMFrNWS1pY= Received: by 10.227.179.196 with SMTP id br4mr679675wbb.81.1300273816991; Wed, 16 Mar 2011 04:10:16 -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 x1sm987876wbh.14.2011.03.16.04.10.14 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 16 Mar 2011 04:10:15 -0700 (PDT) Message-ID: <4D809A96.6050209@gmail.com> Date: Wed, 16 Mar 2011 13:10:14 +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> In-Reply-To: <4D7F5FD0020000250003B8E1@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=-2.599 tagged_above=-5 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7 X-Spam-Level: X-Archive-Number: 201103/229 X-Sequence-Number: 29739 Hi Kevin! Thanks for your reply. You make me feel that this is more serious than I thought. This is development server, that is also used as pre-live server. Pre-live database is restored from live database dump every night. So far the errors have been in pre-live database, that's why I didn't worry too much - it is anyway overwritten every night from backup. Usually the next day error was gone. I mostly blamed badly timed backup and restore scripts, although this shouldn't result in errors. The errors started from 07.09.2010, when I was still running PostgreSQL 8.1. Few examples: 07.09.2010: Warning: pg_dump: ERROR: could not open relation with OID 339815468 pg_dump: SQL command to dump the contents of table "kannete_read" failed: PQendcopy() failed. pg_dump: Error message from server: ERROR: could not open relation with OID 339815468 pg_dump: The command was: COPY public.kannete_read (yhistu_id, kande_rea_id, kande_id, konto_nr, alamkonto_nr, deebetsumma, kreeditsumma, deebetsaldo, kreeditsaldo, alamkonto_deebetsaldo, alamkonto_kreeditsaldo, looja, loomise_aeg, muutja, muutmise_aeg, kuupaev, kande_nr, kinnitatud, deebetprotsent, kreeditprotsent) TO stdout; pg_dumpall: pg_dump failed on database "korteriy_histu", exiting 19.09.2010: Warning: pg_dump: ERROR: unexpected chunk number 926884437 (expected 514) for toast value 1736426835 pg_dump: SQL command to dump the contents of table "failid" failed: PQendcopy() failed. pg_dump: Error message from server: ERROR: unexpected chunk number 926884437 (expected 514) for toast value 1736426835 pg_dump: The command was: COPY public.failid (faili_id, yhistu_id, perioodi_id, arve_id, dokumendi_id, tyyp, sisu, laius, korgus, pikkus, faili_nimi, sisu_tyyp, looja, loomise_aeg, muutja, muutmise_aeg) TO stdout; pg_dumpall: pg_dump failed on database "arvetest", exiting 24.09.2010: Warning: pg_dump: socket not open pg_dump: SQL command to dump the contents of table "failid" failed: PQendcopy() failed. pg_dump: Error message from server: socket not open pg_dump: The command was: COPY public.failid (faili_id, yhistu_id, perioodi_id, arve_id, dokumendi_id, tyyp, sisu, laius, korgus, pikkus, faili_nimi, sisu_tyyp, looja, loomise_aeg, muutja, muutmise_aeg) TO stdout; pg_dumpall: pg_dump failed on database "arvetest", exiting 9.11.2010: Warning: pg_dump: Dumping the contents of table "maaramised" failed: PQgetCopyData() failed. pg_dump: Error message from server: server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request. pg_dump: The command was: COPY public.maaramised (maaramise_id, kululiigi_id, perioodi_id, yhistu_id, korteri_id, kogus, yhik, hind, summa, looja, loomise_aeg, muutja, muutmise_aeg) TO stdout; pg_dumpall: pg_dump failed on database "arvetest", exiting More recently after I upgraded to 8.4, 11.02.2010: Warning: pg_dump: SQL command failed pg_dump: Error message from server: ERROR: compressed data is corrupt pg_dump: The command was: COPY public.failid (faili_id, yhistu_id, perioodi_id, arve_id, dokumendi_id, tyyp, sisu, laius, korgus, pikkus, faili_nimi, sisu_tyyp, looja, loomise_aeg, muutja, muutmise_aeg) TO stdout; pg_dumpall: pg_dump failed on database "korteriy_histu", exiting The current error has occurred 3 days in a row - 13-15.03.2011: Warning: pg_dump: SQL command failed pg_dump: Error message from server: ERROR: found toasted toast chunk for toast value 260340218 in pg_toast_260339342 pg_dump: The command was: COPY public.yhistud_urlcache (id, url, params, sess_id, content) TO stdout; pg_dumpall: pg_dump failed on database "yhistud", exiting This time the error is not in pre-live database and therefore it doesn't go away. I have not noticed any unusual errors in other services. The server is also running Subversion, Trac, Apache, Samba, MySQL, Oracle, Tomcat and so on. PostgreSQL, Subversion, Trac and Apache+PHP are used actively every day. Both fsync and full_page_writes are 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. I run Debian testing on that machine. Currently I blame either faulty memory or faulty software RAID driver. I can easily eliminate the memory cause by running memtest86 for few hours. But how do I eliminate the software RAID driver? PostgreSQL has always been solid for me, so I suspect it least, but you never know... Now, off to buy UPS... Tambet On 15.03.2011 19:47, Kevin Grittner wrote: > "Tambet Matiisen" wrote: > >> For a few days I've been getting this error from my nightly backup >> script: >> >> Warning: pg_dump: SQL command failed pg_dump: Error message from >> server: ERROR: found toasted toast chunk for toast value 260340218 >> in pg_toast_260339342 pg_dump: The command was: COPY >> public.yhistud_urlcache (id, url, params, sess_id, content) TO >> stdout; pg_dumpall: pg_dump failed on database "yhistud", exiting >> Warning: Failed to dump pgsql cluster > > So you don't have a current backup, and your database is corrupted. > > (1) If you still have a backup from before you started getting > backup failures, keep it safe until everything has settled down and > is running well for several months. > > (2) Stop PostgreSQL and do a full copy of the data directory and > everything under it to a backup medium or another machine. Keep > this copy safe for months, too. > >> Yesterday I upgraded the server from 8.4.5 to 8.4.7, hoping that >> this error will go away, but no success. > > Newer versions with more bug fixes may be less likely to contain > bugs which could cause corruption, but an upgrade like that is > unlikely to "heal" data which is already corrupted. > >> I've been getting occasional errors from backup script for several >> months, > > Do you know what those were? > >> I have upgraded Linux kernel to 2.6.32, hoping that maybe the >> problem is in software RAID driver, but no changes, occasionally I >> still get errors. > > Occasionally get what errors? > >> I still have to do memory test on the server, but I doubt faulty >> memories are the problem, because otherwise the server behaves >> well. > > So, no problems other than months of errors on backups? Never any > OS lockups, power losses, or other abrupt terminations of > operations? > > Also, do you now or have you ever run the database with fsync = off > or full_page_writes = off? > > It is very important to figure out how your data got corrupted; > otherwise you can't really trust this machine.. > > -Kevin