pgsql: Allow using syncfs() in frontend utilities.

From: Nathan Bossart <nathan(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Allow using syncfs() in frontend utilities.
Date: 2023-09-06 23:28:00
Message-ID: E1qe1wG-002jjs-Fr@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/8c16ad3b43299695f203f9157a2b27c22b9ed634

Modified Files
--------------
doc/src/sgml/config.sgml | 12 +++---------
doc/src/sgml/filelist.sgml | 1 +
doc/src/sgml/postgres.sgml | 1 +
doc/src/sgml/ref/initdb.sgml | 22 +++++++++++++++++++++
doc/src/sgml/ref/pg_basebackup.sgml | 25 ++++++++++++++++++++++++
doc/src/sgml/ref/pg_checksums.sgml | 22 +++++++++++++++++++++
doc/src/sgml/ref/pg_dump.sgml | 21 ++++++++++++++++++++
doc/src/sgml/ref/pg_rewind.sgml | 22 +++++++++++++++++++++
doc/src/sgml/ref/pgupgrade.sgml | 23 ++++++++++++++++++++++
doc/src/sgml/syncfs.sgml | 36 +++++++++++++++++++++++++++++++++++
src/bin/initdb/initdb.c | 6 ++++++
src/bin/initdb/t/001_initdb.pl | 12 ++++++++++++
src/bin/pg_basebackup/pg_basebackup.c | 7 +++++++
src/bin/pg_checksums/pg_checksums.c | 6 ++++++
src/bin/pg_dump/pg_dump.c | 7 +++++++
src/bin/pg_rewind/pg_rewind.c | 8 ++++++++
src/bin/pg_upgrade/option.c | 13 +++++++++++++
src/bin/pg_upgrade/pg_upgrade.c | 6 ++++--
src/bin/pg_upgrade/pg_upgrade.h | 1 +
src/fe_utils/option_utils.c | 27 ++++++++++++++++++++++++++
src/include/fe_utils/option_utils.h | 4 ++++
21 files changed, 271 insertions(+), 11 deletions(-)

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Thomas Munro 2023-09-06 23:50:27 pgsql: Disable 031_recovery_conflict.pl in 15 and 16.
Previous Message Bruce Momjian 2023-09-06 20:52:52 pgsql: doc: mention that to_char() values are rounded

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2023-09-06 23:29:08 Re: should frontend tools use syncfs() ?
Previous Message David G. Johnston 2023-09-06 22:13:33 Re: Can a role have indirect ADMIN OPTION on another role?