pg_upgrade: Allow use of file cloning
Add another transfer mode --clone to pg_upgrade (besides the existing
--link and the default copy), using special file cloning calls. This
makes the file transfer faster and more space efficient, achieving
speed similar to --link mode without the associated drawbacks.
On Linux, file cloning is supported on Btrfs and XFS (if formatted with
reflink support). On macOS, file cloning is supported on APFS.
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/3a769d8239afdc003c91a56d2d8d5adfadacda5d
Modified Files
--------------
configure | 2 +-
configure.in | 1 +
doc/src/sgml/ref/pgupgrade.sgml | 40 +++++++++++++++---
src/bin/pg_upgrade/check.c | 13 +++++-
src/bin/pg_upgrade/file.c | 90 ++++++++++++++++++++++++++++++++++++++++
src/bin/pg_upgrade/option.c | 7 ++++
src/bin/pg_upgrade/pg_upgrade.h | 6 ++-
src/bin/pg_upgrade/relfilenode.c | 44 +++++++++++++-------
src/include/pg_config.h.in | 3 ++
9 files changed, 181 insertions(+), 25 deletions(-)