pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Alexander Shutyaev <shutyaev@gmail.com>
Cc: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: pg_upgrade and wraparound
Date: Mon, 11 Jun 2018 06:12:29 -0700
Message-ID: <29e163a5-3585-5d27-6f3d-e4cfe812b3ec@aklaver.com> (raw)
In-Reply-To: <CAGBp8g9j+VXYRy6QjXz5_LRK=mcPeA-MssWEzDhAAxzY_17mqw@mail.gmail.com>
References: <CAGBp8g_=Zxfiny8pa8sOb7pDxjzSGmcTBAJGYUrOJ6TDK9+nyQ@mail.gmail.com>
	<107c7c17-2e53-6cd1-1dbd-94d63f7a205f@aklaver.com>
	<9825.1528573946@sss.pgh.pa.us>
	<1528663590828-0.post@n3.nabble.com>
	<bc010ee6-4183-b11d-e401-33b5d67ed8fe@aklaver.com>
	<CAGBp8g8oQz+iwjeXunQaKrAekjmDbxPXLffjTRsSWmwFgJ=2=Q@mail.gmail.com>
	<CAGBp8g-urWCpyMQVPzvDt9xo0E-DCmEasq1j0B5mOcvyK4JWWg@mail.gmail.com>
	<8b14df48-20e9-3dd0-9990-7131f95bd30a@aklaver.com>
	<CAGBp8g_VhOOYXT8iBK7Db4LdLv=xLAtzvD7BJ26P0uz7JHHh7w@mail.gmail.com>
	<bf972d20-62df-64a8-4683-e88c05a2875e@aklaver.com>
	<CAGBp8g9j+VXYRy6QjXz5_LRK=mcPeA-MssWEzDhAAxzY_17mqw@mail.gmail.com>

On 06/10/2018 11:46 PM, Alexander Shutyaev wrote:
>  >> Is this the regular Postgres log or the pg_upgrade log which should 
> be something like pg_upgrade_server.log?
> 
> This is the pg_upgrade_dump_16400.log.
> 
>>> How did you get into the 10 cluster to report on the database OID's and 
> names?
> 
> After the pg_upgrade failed I was able to start both clusters, so I 
> connected to the new 10.4 cluster and ran the query.

I am at a loss for an explanation. My thoughts:

1) The database with an  OID of 0 is a mystery, though it does not seem 
to be stopping the upgrade by itself.

2) The upgrade stops because of transaction ID wraparound, which is 
strange as that is not showing up in the 9.6 cluster I presume. You 
might want the queries found below on the 9.6 and 10 clusters to help 
figure this out:

https://www.postgresql.org/docs/10/static/routine-vacuuming.html#VACUUM-FOR-WRAPAROUND

SELECT c.oid::regclass as table_name,
        greatest(age(c.relfrozenxid),age(t.relfrozenxid)) as age
FROM pg_class c
LEFT JOIN pg_class t ON c.reltoastrelid = t.oid
WHERE c.relkind IN ('r', 'm');

SELECT datname, age(datfrozenxid) FROM pg_database;

> 
>>> Which database has the large objects?
> 
> bof (OID=16400). It is also effectively the only database that matters 
> here. The other one - sslentry only contains a couple of tables and a 
> dozen of records.
> 
>>> Did you check this view to confirm?
> 
> Yes, I did:
> 
> select * from pg_prepared_xacts;
>   transaction | gid | prepared | owner | database
> -------------+-----+----------+-------+----------
> (0 rows)
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com




view thread (30+ messages)  latest in thread

Message-ID: <29e163a5-3585-5d27-6f3d-e4cfe812b3ec@aklaver.com>
Permalink:  ../29e163a5-3585-5d27-6f3d-e4cfe812b3ec@aklaver.com/
Also on:    postgresql.org/message-id/29e163a5-3585-5d27-6f3d-e4cfe812b3ec@aklaver.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: adrian.klaver@aklaver.com, shutyaev@gmail.com
  Subject: Re: pg_upgrade and wraparound
  In-Reply-To: <29e163a5-3585-5d27-6f3d-e4cfe812b3ec@aklaver.com>
  References: <CAGBp8g_=Zxfiny8pa8sOb7pDxjzSGmcTBAJGYUrOJ6TDK9+nyQ@mail.gmail.com> <107c7c17-2e53-6cd1-1dbd-94d63f7a205f@aklaver.com> <9825.1528573946@sss.pgh.pa.us> <1528663590828-0.post@n3.nabble.com> <bc010ee6-4183-b11d-e401-33b5d67ed8fe@aklaver.com> <CAGBp8g8oQz+iwjeXunQaKrAekjmDbxPXLffjTRsSWmwFgJ=2=Q@mail.gmail.com> <CAGBp8g-urWCpyMQVPzvDt9xo0E-DCmEasq1j0B5mOcvyK4JWWg@mail.gmail.com> <8b14df48-20e9-3dd0-9990-7131f95bd30a@aklaver.com> <CAGBp8g_VhOOYXT8iBK7Db4LdLv=xLAtzvD7BJ26P0uz7JHHh7w@mail.gmail.com> <bf972d20-62df-64a8-4683-e88c05a2875e@aklaver.com> <CAGBp8g9j+VXYRy6QjXz5_LRK=mcPeA-MssWEzDhAAxzY_17mqw@mail.gmail.com> <29e163a5-3585-5d27-6f3d-e4cfe812b3ec@aklaver.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