Add --copy-file-range option to pg_upgrade.
Thomas Munro <tmunro@postgresql.org>
Add --copy-file-range option to pg_upgrade. The copy_file_range() system call is available on at least Linux and FreeBSD, and asks the kernel to use efficient ways to copy ranges of a file. Options available to the kernel include sharing block ranges (similar to --clone mode), and pushing down block copies to the storage layer. For automated testing, see PG_TEST_PG_UPGRADE_MODE. (Perhaps in a later commit we could consider setting this mode for one of the CI targets.) Reviewed-by: Peter Eisentraut <peter@eisentraut.org> Discussion: https://postgr.es/m/CA%2BhUKGKe7Hb0-UNih8VD5UNZy5-ojxFb3Pr3xSBBL8qj2M2%3DdQ%40mail.gmail.com
Files
| Path | Change | +/− |
|---|---|---|
| configure | modified | +1 −1 |
| configure.ac | modified | +1 −0 |
| doc/src/sgml/ref/pgupgrade.sgml | modified | +13 −0 |
| meson.build | modified | +1 −0 |
| src/bin/pg_upgrade/check.c | modified | +3 −0 |
| src/bin/pg_upgrade/file.c | modified | +78 −0 |
| src/bin/pg_upgrade/option.c | modified | +6 −1 |
| src/bin/pg_upgrade/pg_upgrade.h | modified | +4 −0 |
| src/bin/pg_upgrade/relfilenumber.c | modified | +8 −0 |
| src/bin/pg_upgrade/TESTING | modified | +2 −2 |
| src/include/pg_config.h.in | modified | +3 −0 |
Documentation touched
Discussion
- pg_upgrade --copy-file-range 46 messages · 2023-06-02 → 2024-04-07