Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id CD0662E002F for ; Tue, 15 Apr 2008 03:36:37 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 41728-04 for ; Tue, 15 Apr 2008 03:36:34 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.176]) by developer.postgresql.org (Postfix) with ESMTP id B1D1D2E0030 for ; Tue, 15 Apr 2008 03:36:34 -0300 (ADT) Received: by wa-out-1112.google.com with SMTP id n7so3168385wag.5 for ; Mon, 14 Apr 2008 23:36:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; bh=H5AmLb4leTi9j0sMMEDtENBW5I4RGjcDDlQ7C33QKp0=; b=jfnBBx8cIc0bf3gzkcJvP02puHR0uaISUykr1KNrvlnb4tmo1klUYcyzx5UmQyPYksWMO92nn/vNG5Tqupz+bGhYx6fdhiEEcR75e1Vgugnryxh+108Y5efTGFEnl2xHb1AS+J+YX2qBmGDseBCWsVuLiFV0X99MzSuVdrmnNJo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=XAyehJlFZXU58XjC9LOS1/8n+drNXEqlFmTxgby+hCvXb34A6TJtfgOyoilXlMB8f6qL+zBwEfZSA3F2zCyr38VRmi5u8etngSB26n+If6AAvHX0aEMXFN4DqroutoAkEXN4aFedxGvPiny61N0+cY3KVjArjJaPR56oDHufSmA= Received: by 10.114.67.2 with SMTP id p2mr7920603waa.1.1208241393860; Mon, 14 Apr 2008 23:36:33 -0700 (PDT) Received: by 10.114.102.14 with HTTP; Mon, 14 Apr 2008 23:36:33 -0700 (PDT) Message-ID: <2ca799770804142336q6422af38me80054c82699d1e2@mail.gmail.com> Date: Tue, 15 Apr 2008 09:36:33 +0300 From: "Mikko Partio" To: pgsql-admin@postgresql.org Subject: Re: FATAL: could not open relation xxx: No such file or directory In-Reply-To: <2ca799770804090647m759b72f9gf2d49b4bf7cc8bdf@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_36542_26640177.1208241393854" References: <2ca799770804090647m759b72f9gf2d49b4bf7cc8bdf@mail.gmail.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200804/138 X-Sequence-Number: 28902 ------=_Part_36542_26640177.1208241393854 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On Wed, Apr 9, 2008 at 4:47 PM, Mikko Partio wrote: > Hello all > > my struggle with the database continues (see earlier thread titled "too > many trigger records found for relation xyz"). > > Today, I created yet another to table to the same database. Everything > went ok, no errors or anything, but when I checked pg_tables -view I saw two > tables with the same name. Instantly I queried pg_class and yes there was > again two tables with same oid. I dropped the table before anything more > serious could happen, but then postgres started to complain of "cache lookup > failed for relation ...". I disconnected my psql session and tried to > reconnect but failed to do so: > > 2008-04-09 16:39:25 EEST [18984]: [1-1] FATAL: could not open relation > 1663/16386/544592: No such file or directory > > Indeed, there is no such file in that directory. I'm guessing that file is > connected to the table I just dropped. Now, is there anything to do to get > the database back online? I can still connect to other databases in the same > instance The cure was to create file 1663/16386/54459 8K in size with dd. The file in question was in fact the oid index on pg_class -- I had issued a REINDEX on pg_class just a moment before and apparantly something went wrong and the system lost track of the index. There was also two entries in pg_index for index pg_class_oid_index. After I removed the other entry and reindexed pg_class and pg_index, everything seems to be working ok. All the symptoms indicate that perhaps a xid wraparound had happened, but there is no such warning in logs and age(datfrozenxid) went never higher than say 250,000,000. Does anybody have a clue what might have happened? Regards Mikko ------=_Part_36542_26640177.1208241393854 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline

On Wed, Apr 9, 2008 at 4:47 PM, Mikko Partio <mpartio@gmail.com> wrote:
Hello all

my struggle with the database continues (see earlier thread titled "too many trigger records found for relation xyz").

Today, I created yet another to table to the same database. Everything went ok, no errors or anything, but when I checked pg_tables -view I saw two tables with the same name. Instantly I queried pg_class and yes there was again two tables with same oid. I dropped the table before anything more serious could happen, but then postgres started to complain of "cache lookup failed for relation ...". I disconnected my psql session and tried to reconnect but failed to do so:

2008-04-09 16:39:25 EEST [18984]: [1-1] FATAL:  could not open relation 1663/16386/544592: No such file or directory

Indeed, there is no such file in that directory. I'm guessing that file is connected to the table I just dropped. Now, is there anything to do to get the database back online? I can still connect to other databases in the same instance

The cure was to create file 1663/16386/54459 8K in size with dd. The file in question was in fact the oid index on pg_class -- I had issued a REINDEX on pg_class just a moment before and apparantly something went wrong and the system lost track of the index. There was also two entries in pg_index for index pg_class_oid_index. After I removed the other entry and reindexed pg_class and pg_index, everything seems to be working ok. All the symptoms indicate that perhaps a xid wraparound had happened, but there is no such warning in logs and age(datfrozenxid) went never higher than say 250,000,000. Does anybody have a clue what might have happened?

Regards

Mikko



------=_Part_36542_26640177.1208241393854--