diff options
author | Nathan Bossart | 2023-09-06 23:27:00 +0000 |
---|---|---|
committer | Nathan Bossart | 2023-09-06 23:27:00 +0000 |
commit | cccc6cdeb32f010f1cf777a9e9a85344a4317ab8 (patch) | |
tree | 989510ddcfe04a8503da11931e5c043dee189cfc /src/bin/pg_rewind/pg_rewind.h | |
parent | 3ed19567198ddb34ab32be6ebdf132148287abdf (diff) |
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
Diffstat (limited to 'src/bin/pg_rewind/pg_rewind.h')
-rw-r--r-- | src/bin/pg_rewind/pg_rewind.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/bin/pg_rewind/pg_rewind.h b/src/bin/pg_rewind/pg_rewind.h index ef8bdc1fbb8..05729adfef3 100644 --- a/src/bin/pg_rewind/pg_rewind.h +++ b/src/bin/pg_rewind/pg_rewind.h @@ -13,6 +13,7 @@ #include "access/timeline.h" #include "common/logging.h" +#include "common/file_utils.h" #include "datapagemap.h" #include "libpq-fe.h" #include "storage/block.h" @@ -24,6 +25,7 @@ extern bool showprogress; extern bool dry_run; extern bool do_sync; extern int WalSegSz; +extern DataDirSyncMethod sync_method; /* Target history */ extern TimeLineHistoryEntry *targetHistory; |