Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 92227F4BA26 for ; Thu, 10 Nov 2011 01:53:04 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 05002-10 for ; Thu, 10 Nov 2011 05:52:58 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from smtp13.mail.ru (smtp13.mail.ru [94.100.176.90]) by mail.postgresql.org (Postfix) with ESMTP id 475FCF4BA24 for ; Thu, 10 Nov 2011 01:52:57 -0400 (AST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.ru; s=mail; h=Content-Transfer-Encoding:Content-Type:Mime-Version:References:In-Reply-To:Message-ID:Subject:Cc:To:From:Date; bh=pINujE4X27THPGXoMVqQlllDzYcxb8VLVwa8gU8kolk=; b=Kwg/q4bsRA081Exkg7KrGbGpm9NHDGsn0nodr6x4DdH8GQF8R6xiZxweV2gVMkW75kHBzEWuBsnS51qArfjip438lPqSNveV1UeDI5aUDF+OEql8CWFECm6b0+gpQItC; Received: from [95.174.102.250] (port=37178 helo=localhost) by smtp13.mail.ru with asmtp id 1RONZI-0002Fw-00; Thu, 10 Nov 2011 09:52:56 +0400 Date: Thu, 10 Nov 2011 09:53:31 +0400 From: "Ruslan A. Bondar" To: Craig Ringer Cc: pgsql-admin@postgresql.org Subject: Re: How to deal with corrupted database? Message-ID: <20111110095331.0772436d@list.ru> In-Reply-To: <4EBB38C7.6030707@ringerc.id.au> References: <20111109150225.076c2f38@list.ru> <4EBA7A6F.50602@ringerc.id.au> <20111109173744.7592798e@list.ru> <4EBB38C7.6030707@ringerc.id.au> X-Mailer: Claws Mail 3.7.10 (GTK+ 2.24.6; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam: Not detected X-Mras: Ok X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201111/41 X-Sequence-Number: 38635 > > So I've stopped software caused these inserts and deletes, but > > reindexing shows same warnings. I've restarted postgresql server. > > How did you restart PostgreSQL? > > If there were backends hung in the vfs, did the eventually terminate > by themselves? If not, did you terminate them yourself? How? With a > signal (kill)? Which signal? Some other way? > Just /etc/init.d/postgresql-9.0 restart As far as I know it uses "smart" shutdown on debian. > > Postgres restarted successfully, but the database became > > unaccessible. Filesystem is clean. File base/16387/86057840 exists > > but is zero length. File pg_subtrans/00F2 does not exists. > > Hm, ok. I'm a bit suspicious of the deadlock in the kernel. It isn't > necessarily a kernel issue, but given the system you're running on I > won't be too surprised if it is either. There's a fairly good chance > the trigger for this was a kernel issue munching your data. > > Are you able to reproduce this issue with another instance of > PostgreSQL running with a freshly created database cluster (initdb) ? Ok. I'll reinit clean cluster, restore databases from backups and will try to reproduce the issue. I'll have nearly the same configuration and data like before crash. Hope the issue will appear. Also I've copied old, corrupted, database for the case issue will not appear in a week. P.S. Yes, the host is xen guest and postgres works under a heavy load. But at a hardware level it uses 4 individual HDD's in a mirror for storing it's data. The filesystem operations should be fast enough.