Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Xotnl-0005oQ-3y for pgsql-bugs@arkaria.postgresql.org; Thu, 13 Nov 2014 12:47:05 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Xotnk-00046T-JU for pgsql-bugs@arkaria.postgresql.org; Thu, 13 Nov 2014 12:47:04 +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 1Xotni-00044Q-Tq for pgsql-bugs@postgresql.org; Thu, 13 Nov 2014 12:47:02 +0000 Received: from mail-am1on0609.outbound.protection.outlook.com ([2a01:111:f400:fe00::609] helo=emea01-am1-obe.outbound.protection.outlook.com) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Xotne-00006x-51 for pgsql-bugs@postgresql.org; Thu, 13 Nov 2014 12:47:01 +0000 Received: from [IPv6:2a00:1f78:fffb:310:1920:7af1:694b:ad54] (2a00:1f78:fffb:310:1920:7af1:694b:ad54) by AMSPR03MB616.eurprd03.prod.outlook.com (10.242.107.18) with Microsoft SMTP Server (TLS) id 15.1.16.15; Thu, 13 Nov 2014 12:46:52 +0000 Message-ID: <5464A838.5070705@innogames.de> Date: Thu, 13 Nov 2014 13:46:48 +0100 From: Bernhard Schrader User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Alvaro Herrera , David Gould CC: Subject: Re: BUG #11264: Auto vacuum wraparound job blocking everything References: <20140825225029.2536.5315@wrigleys.postgresql.org> <20140827152636.GC7046@eldon.alvh.no-ip.org> <33085ff949d9484f8d3e6a1b86d15717@CO2PR05MB569.namprd05.prod.outlook.com> <20140827154800.GE7046@eldon.alvh.no-ip.org> <20140827164527.GG7046@eldon.alvh.no-ip.org> <20140827175105.GI7046@eldon.alvh.no-ip.org> <20141001213211.GW5311@eldon.alvh.no-ip.org> In-Reply-To: <20141001213211.GW5311@eldon.alvh.no-ip.org> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [2a00:1f78:fffb:310:1920:7af1:694b:ad54] X-ClientProxiedBy: DB4PR04CA0010.eurprd04.prod.outlook.com (25.160.41.20) To AMSPR03MB616.eurprd03.prod.outlook.com (10.242.107.18) X-Microsoft-Antispam: UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:AMSPR03MB616; X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:;SRVR:AMSPR03MB616; X-Forefront-PRVS: 0394259C80 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(189002)(51704005)(24454002)(199003)(33656002)(46102003)(59896002)(64126003)(31966008)(87976001)(102836001)(101416001)(83506001)(80316001)(92566001)(15975445006)(4396001)(19580395003)(74482002)(50466002)(92726001)(15202345003)(23746002)(120916001)(99396003)(50986999)(21056001)(87266999)(95666004)(76176999)(54356999)(107046002)(105586002)(65816999)(36756003)(122386002)(97736003)(42186005)(551934003)(47776003)(64706001)(20776003)(62966003)(65956001)(40100003)(77096003)(77156002)(106356001)(7059030)(3826002); DIR:OUT; SFP:1101; SCL:1; SRVR:AMSPR03MB616; H:[IPv6:2a00:1f78:fffb:310:1920:7af1:694b:ad54]; FPR:; MLV:sfv; PTR:InfoNoRecords; MX:1; A:1; LANG:en; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:;SRVR:AMSPR03MB616; X-OriginatorOrg: innogames.de 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 On 01.10.2014 23:32, Alvaro Herrera wrote: > David Gould wrote: > >> We ran into this on two instances last night and I'm starting to worry that >> many others may hit it as well. As far as I can tell any postgres instance >> that was upgraded to 9.3 by a pre-9.3.5 pg_upgrade is at risk as they all >> will have: >> >> Latest checkpoint's oldestMultiXid: 1 >> >> The workaround above is good if you still have the old cluster around from >> before the upgrade. We did not, that was all cleaned up months ago. Which >> raises the question: how do you fix a 9.3 instance that has oldestMultiXid = >> 1 without access to the pre-upgrade instance. That is, where do you get the >> correct value of oldestMultiXid to set into pg_database.datxminmxid? >> >> I took a guess that the oldest pg_class.relminmxid for all the tables in all >> the databases would be ok and updated pg_database.datminmxid witt that. That >> is, in each database I ran: >> >> select relname, relminmxid, age(relminmxid) >> from pg_class >> where relkind = 'r' >> and age(relminmxid) < 2147483647 >> order by 3 desc limit 1 ; > Unfortunately, the age() function is only valid for transaction IDs, not > multixacts. In certain cases the values returned might be sensible, but > they don't have to be, and if the counters are not relatively close to > one another, most likely they won't be sensible. A new function was > added to 9.4, but that doesn't help those in 9.3. > http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=36ad1a87a368d837d5c2260b2fd2ff83e976425a > (I guess you could have an extension containing that function.) > My bet is that is the reason you had to add the condition that the value > is less than 2^31 - 1. > > Offhand, other than the way to obtain the multixact age, the procedure > seems sensible. > > A better way not involving mxid_age() would be to use pg_controldata to > extract the current value of the mxid counter, then subtract the current > relminmxid from that value. > >> 3) Is this likely to affect all 9.3.x<5 upgraded databases? > Yes. > Hi, I just have 700 databases which could been affected and i just don't want to dump and restore all of them, so is there a prober way to detect if one is affected or not? E.g. vacuum of all tables or something else? And is a dump, init, restore a way to make 100% sure this bug is fixed? regards Bernhard Schrader -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs