pg_upgrade: Allow use of file cloning

Enterprise / PostgreSQL - Peter Eisentraut [gmx.net] - 7 November 2018 17:35 EST

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.

3a769d8239 pg_upgrade: Allow use of file cloning
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(-)

Upstream: git.postgresql.org


  • Share