Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XZR9c-00041H-Su for pgsql-bugs@arkaria.postgresql.org; Wed, 01 Oct 2014 21:09:45 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XZR9c-0000LY-AU for pgsql-bugs@arkaria.postgresql.org; Wed, 01 Oct 2014 21:09:44 +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 1XZR9a-0000JU-SW for pgsql-bugs@postgresql.org; Wed, 01 Oct 2014 21:09:42 +0000 Received: from c.mail.sonic.net ([64.142.111.80]) by magus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XZR9W-0000Zd-A5 for pgsql-bugs@postgresql.org; Wed, 01 Oct 2014 21:09:41 +0000 Received: from jekyl.lan (184-23-2-97.dsl.dynamic.sonic.net [184.23.2.97]) (authenticated bits=0) by c.mail.sonic.net (8.14.9/8.14.9) with ESMTP id s91L9SEM012127 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Wed, 1 Oct 2014 14:09:29 -0700 Date: Wed, 1 Oct 2014 14:09:45 -0700 From: David Gould To: pgsql-bugs@postgresql.org, alvherre@2ndquadrant.com Subject: Re: BUG #11264: Auto vacuum wraparound job blocking everything - trying again Message-ID: <20141001140945.71681b0f@jekyl.lan> In-Reply-To: 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> X-Mailer: Claws Mail 3.7.4 (GTK+ 2.20.1; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Sonic-CAuth: UmFuZG9tSVZO1eX08CSm/u+dbreh03WgZA2GW1ZfOajfXEhL/eh+D8ejNZNlO+C3MmrUBkkUOGeAj4Uho+fTrewM1J1Lc83Z X-Sonic-ID: C;8p8SO69J5BG3ZYR6lZB5Vg== M;1Ed5O69J5BG3ZYR6lZB5Vg== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-Pg-Spam-Score: -2.5 (--) 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 I sent the following a couple days ago but it seems to have been overlooked. I think this issue may impact a lot of 9.3 sites that have upgraded from earlier versions. Please take a look at this. -dg On Tue, 30 Sep 2014 00:44:11 +0000 (UTC) David Gould wrote: > Alvaro Herrera 2ndquadrant.com> writes: > > > Well, yes, 9.3.4 had a bug fixed by this commit: > > > > Author: Bruce Momjian momjian.us> > > Branch: master [a61daa14d] 2014-07-02 15:29:38 -0400 > > Branch: REL9_4_STABLE [b446a384b] 2014-07-02 15:29:38 -0400 > > Branch: REL9_3_STABLE Release: REL9_3_5 [3d2e18510] 2014-07-02 15:29:38 > -0400 > > > > pg_upgrade: preserve database and relation minmxid values > > > > Also set these values for pre-9.3 old clusters that don't have values > to > > preserve. > > > > Analysis by Alvaro > > > > Backpatch through 9.3 > > > > > How do we fix the current issue with this one server? Is there an easy > fix? > > > Thanks. > > > > As far as I am aware, you should > > UPDATE pg_database SET datminmxid=20783 > > > > and that should fix it. The oldestMulti value in pg_control would get > > updated by itself some time later. If you experience stalls before > > oldestMulti fixes itself, you could stop the server (cleanly!) and then > > pg_resetxlog -m x,y where x is the correct nextMulti value from > > pg_controldata and y is 20783. > > 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 ; > > And then used the oldest one to update pg_database.datminmxid. After a > checkpoint and shutdown/restart I see that it was written to pg_controldata > too. Afterwards I was able to run a vacuum freeze on the problem table. > > Questions: > > 1) Is the procedure above safe and effective for this, or did I just hose my > databases? > > 2) If the procedure above is not safe, what do we do instead? > > 3) Is this likely to affect all 9.3.x<5 upgraded databases? If so, how do we > fix it before too much damage happens in the wider world? \ -- David Gould daveg sonic.net If simplicity worked, the world would be overrun with insects. -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs