From: Nathan Bossart <nathan@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add support for syncfs() in frontend support functions.
Date: Wed, 06 Sep 2023 23:28:00 +0000
Message-ID: <E1qe1wG-002jjq-FT@gemulon.postgresql.org> (raw)
Add support for syncfs() in frontend support functions.
This commit adds support for using syncfs() in fsync_pgdata() and
fsync_dir_recurse() (which have been renamed to sync_pgdata() and
sync_dir_recurse()). Like recovery_init_sync_method,
sync_pgdata() calls syncfs() for the data directory, each
tablespace, and pg_wal (if it is a symlink). For now, all of the
frontend utilities that use these support functions are hard-coded
to use fsync(), but a follow-up commit will allow specifying
syncfs().
Co-authored-by: Justin Pryzby
Reviewed-by: Michael Paquier
Discussion: https://postgr.es/m/20210930004340.GM831%40telsasoft.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/cccc6cdeb32f010f1cf777a9e9a85344a4317ab8
Modified Files
--------------
src/bin/initdb/initdb.c | 7 +-
src/bin/pg_basebackup/pg_basebackup.c | 5 +-
src/bin/pg_checksums/pg_checksums.c | 3 +-
src/bin/pg_dump/pg_backup.h | 4 +-
src/bin/pg_dump/pg_backup_archiver.c | 14 ++-
src/bin/pg_dump/pg_backup_archiver.h | 1 +
src/bin/pg_dump/pg_backup_directory.c | 2 +-
src/bin/pg_dump/pg_dump.c | 3 +-
src/bin/pg_rewind/file_ops.c | 8 +-
src/bin/pg_rewind/pg_rewind.c | 1 +
src/bin/pg_rewind/pg_rewind.h | 2 +
src/common/file_utils.c | 191 +++++++++++++++++++++++++++-------
src/include/common/file_utils.h | 5 +-
13 files changed, 190 insertions(+), 56 deletions(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: nathan@postgresql.org, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Add support for syncfs() in frontend support functions.
In-Reply-To: <E1qe1wG-002jjq-FT@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox