Re: optimize file transfer in pg_upgrade
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: Nathan Bossart <nathandbossart@gmail.com>
Cc: pgsql-hackers@postgresql.org
Date: 2025-02-28T19:40:40Z
Lists: pgsql-hackers
On Wed, Nov 6, 2024 at 5:07 PM Nathan Bossart <nathandbossart@gmail.com> wrote: > these user relation files will have the same name. Therefore, it can be > much faster to instead move the entire data directory from the old cluster > to the new cluster and to then swap the catalog relation files. This is a cool idea. > Another interesting problem is that pg_upgrade currently doesn't transfer > the sequence data files. Since v10, we've restored these via pg_restore. > I believe this was originally done for the introduction of the pg_sequence > catalog, which changed the format of sequence tuples. In the new > catalog-swap mode I am proposing, this means we need to transfer all the > pg_restore-generated sequence data files. If there are many sequences, it > can be difficult to determine which transfer mode and synchronization > method will be faster. Since sequence tuple modifications are very rare, I > think the new catalog-swap mode should just use the sequence data files > from the old cluster whenever possible. Maybe we should rethink the decision not to transfer relfilenodes for sequences. Or have more than one way to do it. pg_upgrade --binary-upgrade --binary-upgrade-even-for-sequences, or whatever. -- Robert Haas EDB: http://www.enterprisedb.com
Commits
-
initdb: Add --no-sync-data-files.
- cf131fa94285 18.0 landed
-
pg_dump: Add --sequence-data.
- 9c49f0e8cd7d 18.0 landed
-
pg_upgrade: Add --swap for faster file transfer.
- 626d7236b65d 18.0 landed
-
Add test for pg_upgrade file transfer modes.
- af0d4901c1c3 18.0 landed
-
Fix an intermetant BF failure in 003_logical_slots.
- 6f97ef05d62a 17.0 cited