Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1X90rG-00056K-QB for pgsql-bugs@arkaria.postgresql.org; Sun, 20 Jul 2014 23:49:34 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1X90rF-0004Up-Rb for pgsql-bugs@arkaria.postgresql.org; Sun, 20 Jul 2014 23:49:33 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1X90rD-0004Ug-Rm for pgsql-bugs@postgresql.org; Sun, 20 Jul 2014 23:49:31 +0000 Received: from mail.anarazel.de ([217.115.131.40]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1X90r8-0005xX-Tv for pgsql-bugs@postgresql.org; Sun, 20 Jul 2014 23:49:30 +0000 Received: from intern.anarazel.de (p5DDC4963.dip0.t-ipconnect.de [93.220.73.99]) (Authenticated sender: andres@anarazel.de) by mail.anarazel.de (Postfix) with ESMTPSA id CF22A500001; Mon, 21 Jul 2014 01:49:25 +0200 (CEST) Date: Mon, 21 Jul 2014 01:49:25 +0200 From: Andres Freund To: Tom Lane Cc: Bruce Momjian , Alvaro Herrera , PostgreSQL Bugs Subject: Re: pg_upgrade < 9.3 -> >=9.3 misses a step around multixacts Message-ID: <20140720234925.GJ5974@alap3.anarazel.de> References: <16274.1405892584@sss.pgh.pa.us> <20140720220253.GE5974@alap3.anarazel.de> <17255.1405894611@sss.pgh.pa.us> <20140720223010.GF5974@alap3.anarazel.de> <17935.1405895946@sss.pgh.pa.us> <20140720225653.GG5974@alap3.anarazel.de> <18673.1405897470@sss.pgh.pa.us> <18851.1405897900@sss.pgh.pa.us> <20140720233125.GI5974@alap3.anarazel.de> <19458.1405899435@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <19458.1405899435@sss.pgh.pa.us> X-Pg-Spam-Score: -2.6 (--) 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 On 2014-07-20 19:37:15 -0400, Tom Lane wrote: > Andres Freund writes: > > On 2014-07-20 19:11:40 -0400, Tom Lane wrote: > >> I wonder whether we should change vac_update_relstats so that it only > >> applies the "relminxid mustn't go backwards" rule as long as relminxid > >> is sane, ie, not in the future. If it is in the future, forcibly update > >> it to the cutoff we actually used. Likewise for relminmxid. And I guess > >> we'd need a similar rule for updating datmin(m)xid. > > > I'm wondering the same. How would we do that from a concurreny POV for > > the pg_database rows? I think we could just accept the race condition > > that two xacts move dbform->datminmxid backwards to different values > > since both have to be 'somewhat' correct? > > Seems no worse than it is today. Well, right now it can only advance, never go backwards. I think. But it don't see how it could matter - all the possible minimum values better be correct. > Is it even possible for two xacts to be trying to update that at the > same time? At least I don't see anything prohibiting it. vac_update_datfrozenxid()( is called straight from vacuum()/do_autovacuum(). The only thing that'll serialize that I can see is the buffer lock for the heap_inplace_update(). Seems odd from a concurrency perspective. Worth a look someday not too far away. > > I think this is out of the remit for 9.3.5. At least I don't have the > > mental capacity to do this properly till tomorrow afternoon. > > Doesn't sound that hard to me (and I'm still reasonably awake, which > I bet you're not). I'm most definitely not awake, right ;). Especially as it's 32 °C in my flat - at 2 in the morning... > Will take a look. Cool. Will take a look at the result tomorrow. Greetings, Andres Freund -- Andres Freund http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs