Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id B2F3CB5DC05 for ; Mon, 29 Aug 2011 15:41:52 -0300 (ADT) 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 64377-02 for ; Mon, 29 Aug 2011 18:41:46 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from spinlock.commandprompt.com (host-215.commandprompt.net [207.173.203.215]) by mail.postgresql.org (Postfix) with ESMTP id 24D93B5D80A for ; Mon, 29 Aug 2011 15:41:45 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by spinlock.commandprompt.com (Postfix) with ESMTP id D482734804A; Mon, 29 Aug 2011 11:41:44 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at commandprompt.com Received: from spinlock.commandprompt.com ([127.0.0.1]) by localhost (spinlock.commandprompt.com.commandprompt.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GaQQSedDSHLS; Mon, 29 Aug 2011 11:41:42 -0700 (PDT) Received: from perhan.alvh.no-ip.org (unknown [200.126.65.205]) by spinlock.commandprompt.com (Postfix) with ESMTPSA id 5E8E6348046; Mon, 29 Aug 2011 11:41:42 -0700 (PDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id CA20F6E458; Mon, 29 Aug 2011 15:41:38 -0300 (CLST) Content-Type: text/plain; charset=UTF-8 Cc: Bruce Momjian , PostgreSQL-development Subject: Re: [GENERAL] pg_upgrade problem From: Alvaro Herrera To: depesz In-reply-to: <20110829174924.GA14101@depesz.com> References: <20110825205318.GA25225@depesz.com> <201108260418.p7Q4Itk17514@momjian.us> <20110826152834.GA7886@depesz.com> <20110829165441.GA28573@depesz.com> <20110829174924.GA14101@depesz.com> Date: Mon, 29 Aug 2011 15:41:38 -0300 Message-Id: <1314643001-sup-6186@alvh.no-ip.org> User-Agent: Sup/git Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201108/1302 X-Sequence-Number: 194057 Excerpts from hubert depesz lubaczewski's message of lun ago 29 14:49:24 -0300 2011: > On Mon, Aug 29, 2011 at 06:54:41PM +0200, hubert depesz lubaczewski wrote: > > On Fri, Aug 26, 2011 at 05:28:35PM +0200, hubert depesz lubaczewski wrote: > > > On Fri, Aug 26, 2011 at 12:18:55AM -0400, Bruce Momjian wrote: > > > > > > > > OK, this was very helpful. I found out that there is a bug in current > > > > 9.0.X, 9.1.X, and HEAD that I introduced recently when I excluded temp > > > > tables. (The bug is not in any released version of pg_upgrade.) The > > > > attached, applied patches should fix it for you. I assume you are > > > > running 9.0.X, and not 9.0.4. > > > > > > pg_upgrade worked. Now I'm doing reindex and later on vacuumdb -az. > > > > vacuumdb failed. The fail looks very similar to the one I had on 9.0.4. > > > > After long vacuum I got: > > INFO: vacuuming "pg_toast.pg_toast_106668498" > > vacuumdb: vacuuming of database "etsy_v2" failed: ERROR: could not access status of transaction 3429738606 > > DETAIL: Could not open file "pg_clog/0CC6": No such file or directory. I don't understand the pg_upgrade code here. It is setting the datfrozenxid and relfrozenxid values to the latest checkpoint's NextXID, /* set pg_class.relfrozenxid */ PQclear(executeQueryOrDie(conn, "UPDATE pg_catalog.pg_class " "SET relfrozenxid = '%u' " /* only heap and TOAST are vacuumed */ "WHERE relkind IN ('r', 't')", old_cluster.controldata.chkpnt_nxtxid)); but I don't see why this is safe. I mean, surely the previous vacuum might have been a lot earlier than that. Are these values reset to more correct values (i.e. older ones) later somehow? My question is, why isn't the new cluster completely screwed? I wonder if pg_upgrade shouldn't be doing the conservative thing here, which AFAICT would be to set all frozenxid values as furthest in the past as possible (without causing a shutdown-due-to-wraparound, and maybe without causing autovacuum to enter emergency mode either). -- Álvaro Herrera The PostgreSQL Company - Command Prompt, Inc. PostgreSQL Replication, Consulting, Custom Development, 24x7 support