Received: from maia.hub.org (maia-4.hub.org [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 7D3B9632D84 for ; Wed, 12 May 2010 08:18:09 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 68490-02 for ; Wed, 12 May 2010 11:18:02 +0000 (UTC) X-Greylist: delayed 00:06:38.368431 by SQLgrey-1.7.6 Received: from mx3.wp.pl (mx3.wp.pl [212.77.101.7]) by mail.postgresql.org (Postfix) with ESMTP id 04718632D51 for ; Wed, 12 May 2010 08:18:01 -0300 (ADT) Received: (wp-smtpd smtp.wp.pl 2814 invoked from network); 12 May 2010 13:11:13 +0200 Received: from aayf104.neoplus.adsl.tpnet.pl (HELO [127.0.0.1]) (ipluta@[83.6.117.104]) (envelope-sender ) by smtp.wp.pl (WP-SMTPD) with AES256-SHA encrypted SMTP for ; 12 May 2010 13:11:13 +0200 Message-ID: <4BEA8CD0.8070108@wp.pl> Date: Wed, 12 May 2010 13:11:12 +0200 From: Ireneusz Pluta User-Agent: Thunderbird 2.0.0.24 (Windows/20100228) MIME-Version: 1.0 To: "pgsql-admin@postgresql.org" Subject: Autovacuum and invalid page header Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-WP-AV: skaner antywirusowy poczty Wirtualnej Polski S. A. X-WP-SPAM: NO 0000000 [IaMk] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.711 tagged_above=-10 required=5 tests=BAYES_20=-0.001, RCVD_IN_DNSWL_LOW=-0.7, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201005/125 X-Sequence-Number: 34598 I had a problem with neverending forced autovacuum process, running as preventing xid wraparound. As I finally (?) found, following some advices given here: -> http://forums.enterprisedb.com/posts/list/2028.page, that autovacuum in question was not just one autovacuum, but many different autovacuums on the same table cycling in start-fail scenario because of invalid page headers of some indexes of the table. Manual VACUUM VERBOSE said me that, now I can also see that in related ERROR-CONTEXT log message pairs. I dropped the damaged indexes and now that autovacuum seems to continue without repeating itself. Anyway, another questions come from that situation and I'd like to discuss them here and get some advice. First, it seems that an unnoticed damage of a relation, causing autovacuum failures, which might initially be harmless for the whole cluster (as far as only damaged relation and its disk space is concerned), may lead to a critical situation when a wraparound gets close, and autovacuum is in prevenitng mode can't freeze its xids. The forced autovacuum insists on vacuuming the table which can not be vacuumed and locks itself there. At the same time, autovacuum get sticked with a database of the damaged relation, and "forgets" about other databases which might need me vacuumed. From this point of view, just one damaged table might be a single point of failure of the whole cluster. Is there any way, other than tracing logs, to prevent such a situation? Another issue, rather loosely related to the topic. I suspect that the cluster may have more invalid page headers like that. They might be caused by past bad sector failures of one of the drives of my raid array. So I think it might be a good idea to check the whole cluster, page by page, for invalid page headers. Is there any ready tool, which, for instance when given a path to database cluster, would traverse all cluster directories and files and check all page headers? I probably answered myself - manual VACUUM [VERBOSE] would do - but it fails when finds the first invalid header, so I would have. That's why I am looking for something only scanning and reporting invalid headers. Yet another issue: how could that happen, the bad sectors of a RAID10 member drive caused page damages? (as far as I am right in this assumption, of course, but I have a reason to think so). Should not the RAID array prevent such a file damage? Thanks Irek.