Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1X8v2z-0005ih-3u for pgsql-bugs@arkaria.postgresql.org; Sun, 20 Jul 2014 17:37:17 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1X8v2y-0002P1-JB for pgsql-bugs@arkaria.postgresql.org; Sun, 20 Jul 2014 17:37:16 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1X8v2w-0002MH-Ui for pgsql-bugs@postgresql.org; Sun, 20 Jul 2014 17:37:15 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1X8v2t-0002uf-IR for pgsql-bugs@postgresql.org; Sun, 20 Jul 2014 17:37:13 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id s6KHb1HT009880; Sun, 20 Jul 2014 13:37:01 -0400 From: Tom Lane To: Bruce Momjian cc: Alvaro Herrera , Andres Freund , PostgreSQL Bugs Subject: Re: pg_upgrade < 9.3 -> >=9.3 misses a step around multixacts In-reply-to: <20140701193047.GB16033@momjian.us> References: <20140619020633.GA20469@momjian.us> <20140619015205.GD3806@momjian.us> <20140619014034.GC3806@momjian.us> <20140619220425.GQ18688@eldon.alvh.no-ip.org> <20140620010653.GS18688@eldon.alvh.no-ip.org> <20140620180725.GD29143@momjian.us> <20140624201346.GB17110@momjian.us> <20140627210520.GP7340@eldon.alvh.no-ip.org> <20140701161419.GA16033@momjian.us> <20140701190105.GA7340@eldon.alvh.no-ip.org> <20140701193047.GB16033@momjian.us> Comments: In-reply-to Bruce Momjian message dated "Tue, 01 Jul 2014 15:30:47 -0400" Date: Sun, 20 Jul 2014 13:37:01 -0400 Message-ID: <9879.1405877821@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Bruce Momjian writes: > On Tue, Jul 1, 2014 at 03:01:06PM -0400, Alvaro Herrera wrote: >> Finally, there is the question of what to do if the database has already >> been upgraded and thus the tables are all at relminmxid=1. As far as I >> can tell, if the original value of nextMulti was below 2^31, there >> should be no issue because vacuuming would advance the value normally. >> If the original value was beyond that point, then vacuum would have been >> bleating all along about the wraparound point. In this case, I think it >> should be enough the UPDATE the pg_class values to the current >> oldestMulti value from pg_control, but I haven't tested this. > Well, we are already having users run a query for the 9.3.X minor > version upgrade to optionally remove the 0000 file. Is there something > else they should run to test for this? We certainly could check for > files >= 8000, but I am not sure that is sufficient. We would then need > them to somehow update all the database/relation minmxid fields, and I > am not even sure what value we should set it to. Is that something we > want to publish? I started transcribing Bruce's proposed fix procedure at https://wiki.postgresql.org/wiki/20140702pg_upgrade_fix into the release notes, but I'm afraid it's all wet. He's suggesting copying the last checkpoint's NextMultiXactId into datminmxid/relminmxid, which is surely the wrong thing: that's likely to be newer than all mxids in the tables, not older than them. I thought at first that this was a simple thinko and he meant to write oldestMultiXid, but here's the thing: if we're in the situation where we've got wraparound, isn't oldestMultiXid going to be 1? The value recorded in the checkpoint isn't magic, it's just going to be extracted from whatever's in pg_database; and the whole problem here is that we can't trust that data. Where can we get a useful lower bound from? I'm a bit inclined to not say anything about fix procedures in the release notes, because I'm not sure that this is a problem in the field. If anybody did have a wraparound they'd be getting bleats from VACUUM, and no one has reported any such thing that I've heard. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs