Re: use CREATE DATABASE STRATEGY = FILE_COPY in pg_upgrade

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Nathan Bossart <nathandbossart@gmail.com>
Cc: Robert Haas <robertmhaas@gmail.com>, Matthias van de Meent <boekewurm+postgres@gmail.com>, Dilip Kumar <dilipbalaut@gmail.com>, Ranier Vilela <ranier.vf@gmail.com>, pgsql-hackers@postgresql.org
Date: 2024-06-20T04:29:40Z
Lists: pgsql-hackers
On Wed, Jun 19, 2024 at 08:37:17AM -0500, Nathan Bossart wrote:
> My understanding is that you basically have to restart the upgrade from
> scratch if that happens.  I suppose there could be a problem if you try to
> use the half-upgraded cluster after a crash, but I imagine you have a good
> chance of encountering other problems if you do that, too.  So I don't
> think we care...

It's never been assumed that it would be safe to redo a
pg_upgradeafter a crash on a cluster initdb'd for the upgrade, so I
don't think we need to care about that, as well.

One failure I suspect would quickly be faced is OIDs getting reused
again as these are currently kept consistent.
--
Michael

Commits

  1. Use CREATE DATABASE ... STRATEGY = FILE_COPY in pg_upgrade.

  2. Use TRUNCATE to preserve relfilenode for pg_largeobject + index.

  3. initdb: When running CREATE DATABASE, use STRATEGY = WAL_COPY.