Allow using syncfs() in frontend utilities.
Nathan Bossart <nathan@postgresql.org>
Allow using syncfs() in frontend utilities. This commit allows specifying a --sync-method in several frontend utilities that must synchronize many files to disk (initdb, pg_basebackup, pg_checksums, pg_dump, pg_rewind, and pg_upgrade). On Linux, users can specify "syncfs" to synchronize the relevant file systems instead of calling fsync() for every single file. In many cases, using syncfs() is much faster. As with recovery_init_sync_method, this new option comes with some caveats. The descriptions of these caveats have been moved to a new appendix section in the documentation. Co-authored-by: Justin Pryzby Reviewed-by: Michael Paquier, Thomas Munro, Robert Haas, Justin Pryzby Discussion: https://postgr.es/m/20210930004340.GM831%40telsasoft.com
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/config.sgml | modified | +3 −9 |
| doc/src/sgml/filelist.sgml | modified | +1 −0 |
| doc/src/sgml/postgres.sgml | modified | +1 −0 |
| doc/src/sgml/ref/initdb.sgml | modified | +22 −0 |
| doc/src/sgml/ref/pg_basebackup.sgml | modified | +25 −0 |
| doc/src/sgml/ref/pg_checksums.sgml | modified | +22 −0 |
| doc/src/sgml/ref/pg_dump.sgml | modified | +21 −0 |
| doc/src/sgml/ref/pg_rewind.sgml | modified | +22 −0 |
| doc/src/sgml/ref/pgupgrade.sgml | modified | +23 −0 |
| doc/src/sgml/syncfs.sgml | added | +36 −0 |
| src/bin/initdb/initdb.c | modified | +6 −0 |
| src/bin/initdb/t/001_initdb.pl | modified | +12 −0 |
| src/bin/pg_basebackup/pg_basebackup.c | modified | +7 −0 |
| src/bin/pg_checksums/pg_checksums.c | modified | +6 −0 |
| src/bin/pg_dump/pg_dump.c | modified | +7 −0 |
| src/bin/pg_rewind/pg_rewind.c | modified | +8 −0 |
| src/bin/pg_upgrade/option.c | modified | +13 −0 |
| src/bin/pg_upgrade/pg_upgrade.c | modified | +4 −2 |
| src/bin/pg_upgrade/pg_upgrade.h | modified | +1 −0 |
| src/fe_utils/option_utils.c | modified | +27 −0 |
| src/include/fe_utils/option_utils.h | modified | +4 −0 |
Documentation touched
Discussion
- should frontend tools use syncfs() ? 50 messages · 2021-09-30 → 2023-10-13