On Sun, May 16, 2021 at 1:23 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> it gets an insane value:
>
> oldestfxid 18446744071709568230, latest_completed 16613, oldestxid 2294983910
>
> And the reason oldestXID contains that is that pg_upgrade applied
> pg_resetwal, which does this:
>
> /*
> * For the moment, just set oldestXid to a value that will force
> * immediate autovacuum-for-wraparound. It's not clear whether adding
> * user control of this is useful, so let's just do something that's
> * reasonably safe. The magic constant here corresponds to the
> * maximum allowed value of autovacuum_freeze_max_age.
> */
> ControlFile.checkPointCopy.oldestXid = set_xid - 2000000000;
> if (ControlFile.checkPointCopy.oldestXid < FirstNormalTransactionId)
> ControlFile.checkPointCopy.oldestXid += FirstNormalTransactionId;
This same pg_resetwal code has probably caused quite a few problems on
pg_upgrade'd databases:
https://postgr.es/m/20210423234256.hwopuftipdmp3okf@alap3.anarazel.de
--
Peter Geoghegan