Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id DAB8E633347 for ; Sun, 28 Mar 2010 14:48:43 -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 96496-07 for ; Sun, 28 Mar 2010 17:48:33 +0000 (UTC) X-Greylist: delayed 00:06:38.537261 by SQLgrey-1.7.6 Received: from mmmail.mcr.colo.comodoca.net (unknown [91.209.196.71]) by mail.postgresql.org (Postfix) with ESMTP id 1CAC5632D83 for ; Sun, 28 Mar 2010 14:48:32 -0300 (ADT) Received: (qmail 29766 invoked by uid 1009); 28 Mar 2010 17:41:51 -0000 Received: from Unknown (HELO tecra.localnet) (192.168.22.137) (smtp-auth username mikew, mechanism plain) by mmmail.mcr.colo.comodoca.net (qpsmtpd/0.40) with (AES256-SHA encrypted) ESMTPSA; Sun, 28 Mar 2010 18:41:51 +0100 From: Mike Williams To: pgsql-admin@postgresql.org Subject: ERROR: could not open segment 1 of relation 1663/743352/743420 (target block 6407642): No such file or directory Date: Sun, 28 Mar 2010 17:41:41 +0000 User-Agent: KMail/1.12.4 (Linux/2.6.31-gentoo-r6; KDE/4.3.5; i686; ; ) MIME-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <201003281841.41865.mike.williams@comodo.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.499 tagged_above=-10 required=5 tests=BAYES_00=-2.599, RDNS_NONE=0.1 X-Spam-Level: X-Archive-Number: 201003/210 X-Sequence-Number: 34009 Hi guys, We upgraded from 8.3.5 to 8.3.9 yesterday, after an extended period of testing, to 8.3.10 today in hope of fixing it, and we're getting the following error on occasion. ERROR: could not open segment 1 of relation 1663/743352/743420 (target block 2171336): No such file or directory CONTEXT: SQL statement "SELECT day FROM min_stats WHERE day<= $1 AND unique_ip=-1 ORDER BY day DESC LIMIT 1" PL/pgSQL function "update_unique_ips" line 13 at SQL statement update_unique_ips() is called once per minute, but we get anywhere from one error per minute, to one error per hour. Relation 743420 in database 743352 is 441270272 bytes long and growing by a few thousand bytes here and there. Obviously, as we've gone from 8.3.9 to 8.3.10, we're restarted postgres a few times. We have also REINDEXd each table, the database, dropped and re-created all the indexes. I've even pg_dump'd the database, and loaded it into a fresh database. The relation numbers changed, but the 1663 bit remained the same. Best I can tell it's this bit of code from the beginning of update_unique_ips() that's doing it, but it seems completely innocuous to me. CREATE FUNCTION update_unique_ips() RETURNS timestamp without time zone AS $$ DECLARE last_day timestamp; day_for_update timestamp; BEGIN -- declare last_day SELECT INTO last_day day-interval '30 min' as day FROM min_stats ORDER BY day DESC LIMIT 1; SELECT INTO day_for_update day FROM min_stats WHERE day<=last_day AND unique_ip=-1 ORDER BY day DESC LIMIT 1; Could anyone help us out here please? Thanks -- Mike Williams