Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1X8yt5-0007hl-30 for pgsql-bugs@arkaria.postgresql.org; Sun, 20 Jul 2014 21:43:19 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1X8yt4-0006kI-Ja for pgsql-bugs@arkaria.postgresql.org; Sun, 20 Jul 2014 21:43:18 +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 1X8yt3-0006kC-Tt for pgsql-bugs@postgresql.org; Sun, 20 Jul 2014 21:43:18 +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 1X8yt0-0007L9-Tz for pgsql-bugs@postgresql.org; Sun, 20 Jul 2014 21:43:16 +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 s6KLh4Ka016275; Sun, 20 Jul 2014 17:43:04 -0400 From: Tom Lane To: Andres Freund cc: Bruce Momjian , Alvaro Herrera , PostgreSQL Bugs Subject: Re: pg_upgrade < 9.3 -> >=9.3 misses a step around multixacts In-reply-to: <20140720213258.GD5974@alap3.anarazel.de> References: <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> <9879.1405877821@sss.pgh.pa.us> <20140720200225.GA5974@alap3.anarazel.de> <13755.1405887378@sss.pgh.pa.us> <20140720204852.GB5974@alap3.anarazel.de> <15685.1405891368@sss.pgh.pa.us> <20140720213258.GD5974@alap3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Sun, 20 Jul 2014 23:32:58 +0200" Date: Sun, 20 Jul 2014 17:43:04 -0400 Message-ID: <16274.1405892584@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 Andres Freund writes: > On 2014-07-20 17:22:48 -0400, Tom Lane wrote: >> 4. The patch Bruce applied to initialize datminmxid/relminmxid to the old >> NextMultiXactId rather than 1 does not fundamentally change anything here. >> It narrows the window in which wraparound can cause problems, but only by >> the distance that "1" is in-the-future at the time of upgrade. > I think it's actually more than that. Consider what happens if > pg_upgrade has used pg_resetxlog to set nextMulti to > 2^31. If > rel/datminmxid are set to 1 regardless vac_update_relstats() and > vac_update_datfrozenxid() won't increase them anymore because of: > /* relminmxid must never go backward, either */ > if (MultiXactIdIsValid(minmulti) && > MultiXactIdPrecedes(pgcform->relminmxid, minmulti)) > { > pgcform->relminmxid = minmulti; > dirty = true; > } > And that can actually cause significant problems once 9.3+ creates new > multis because they'll never get vacuumed away but still do get > truncated. If it's an updating multi xmax that can effectively make the > row unreadable - not just block updates. No, I don't think so. Truncation is driven off oldestMultiXid from pg_control, not from relminmxid. The only thing in-the-future values of those will do to us is prevent autovacuum from thinking it must do a full table scan. (In particular, in-the-future values do not cause oldestMultiXid to get advanced, because we're always looking for the oldest value not the newest.) But in any case, we both agree that setting relminmxid to equal nextMulti is completely unsafe in a 9.3 cluster that's already been up. So the proposed fix instructions are certainly wrong. 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