pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jerry Sievers <gsievers19@comcast.net>
To: Bruce Momjian <bruce@momjian.us>
Cc: Jerry Sievers <gsievers19@comcast.net>
Cc: pgsql-general@postgresql.org
Subject: Re: PgUpgrade bumped my XIDs by ~50M?
Date: Wed, 04 Apr 2018 19:13:36 -0500
Message-ID: <87k1tm7bnz.fsf@jsievers.enova.com> (raw)
In-Reply-To: <20180404232827.GD19574@momjian.us>
References: <87sh8a7gh1.fsf@jsievers.enova.com>
	<20180404232827.GD19574@momjian.us>

Bruce Momjian <bruce@momjian.us> writes:

> On Wed, Apr  4, 2018 at 05:29:46PM -0500, Jerry Sievers wrote:
>
>> We have a large >20TB system just pg_upgraded from 9.5 to 9.6 as per the
>> versions shown below.
>> 
>> The system does <5M transactions/day based on sum(commit + abort) from
>> pg_stat_database.
>> 
>> Autovac is running all possible threads now and upon investigating I see
>> that thousands of tables are now above the freeze threshold.  Same
>> tables all appear ~50M xids older than they did yesterday and the
>> upgrade was less than 24 hours ago.
>> 
>> I have a "safety" snap made of the system before upgrade that can be
>> used for inspection.
>> 
>> Any ideas why the age jump?
>
> Uh, you can read how pg_upgrade handles frozen xids in pg_upgrade.c:
>
> 	https://doxygen.postgresql.org/pg__upgrade_8c_source.html#l00543
>
> I am not sure what would have caused such a jump.  pg_upgrade brings
> over the frozen values for each table, and sets the server's frozen
> counter to match the old one.
>
> If you run 'pg_dump --binary-upgrade' you will see the frozen xids being
> transfered:
>
> 	-- For binary upgrade, set heap's relfrozenxid and relminmxid
> 	UPDATE pg_catalog.pg_class
> 	SET relfrozenxid = '558', relminmxid = '1'
> 	WHERE oid = 'public.test'::pg_catalog.regclass;
>
> Is it possible that pg_upgrade used 50M xids while upgrading?

Hi Bruce.

Don't think so, as I did just snap the safety snap and ran another
upgrade on that.

And I also compared txid_current for the upgraded snap and our running
production instance.

The freshly upgraded snap is ~50M txids behind the prod instance.

If this is a not too uncommon case of users running amok, then this time
in particular they really went off the charts :-)

Will investigate...

FYI, this is the same system that a few weeks ago issued complaints
during vacuum of an XID younger than relfrozenxid, which a system
restart did mysteriously resolve.

I hope we're going to be OK here.

Thx

--
Jerry Sievers
Postgres DBA/Development Consulting
e: postgres.consulting@comcast.net
p: 312.241.7800




view thread (8+ messages)  latest in thread

Message-ID: <87k1tm7bnz.fsf@jsievers.enova.com>
Permalink:  ../87k1tm7bnz.fsf@jsievers.enova.com/
Also on:    postgresql.org/message-id/87k1tm7bnz.fsf@jsievers.enova.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: gsievers19@comcast.net, bruce@momjian.us
  Subject: Re: PgUpgrade bumped my XIDs by ~50M?
  In-Reply-To: <87k1tm7bnz.fsf@jsievers.enova.com>
  References: <87sh8a7gh1.fsf@jsievers.enova.com> <20180404232827.GD19574@momjian.us> <87k1tm7bnz.fsf@jsievers.enova.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox