Allow using syncfs() in frontend utilities.
authorNathan Bossart <nathan@postgresql.org>
Wed, 6 Sep 2023 23:27:16 +0000 (16:27 -0700)
committerNathan Bossart <nathan@postgresql.org>
Wed, 6 Sep 2023 23:27:16 +0000 (16:27 -0700)
commit8c16ad3b43299695f203f9157a2b27c22b9ed634
tree895f2febff98495e9d446eab6a8d61b0ace2f37c
parentcccc6cdeb32f010f1cf777a9e9a85344a4317ab8
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
21 files changed:
doc/src/sgml/config.sgml
doc/src/sgml/filelist.sgml
doc/src/sgml/postgres.sgml
doc/src/sgml/ref/initdb.sgml
doc/src/sgml/ref/pg_basebackup.sgml
doc/src/sgml/ref/pg_checksums.sgml
doc/src/sgml/ref/pg_dump.sgml
doc/src/sgml/ref/pg_rewind.sgml
doc/src/sgml/ref/pgupgrade.sgml
doc/src/sgml/syncfs.sgml [new file with mode: 0644]
src/bin/initdb/initdb.c
src/bin/initdb/t/001_initdb.pl
src/bin/pg_basebackup/pg_basebackup.c
src/bin/pg_checksums/pg_checksums.c
src/bin/pg_dump/pg_dump.c
src/bin/pg_rewind/pg_rewind.c
src/bin/pg_upgrade/option.c
src/bin/pg_upgrade/pg_upgrade.c
src/bin/pg_upgrade/pg_upgrade.h
src/fe_utils/option_utils.c
src/include/fe_utils/option_utils.h