diff options
author | Peter Eisentraut <peter_e@gmx.net> | 2016-09-29 12:00:00 -0400 |
---|---|---|
committer | Peter Eisentraut <peter_e@gmx.net> | 2016-09-29 12:00:00 -0400 |
commit | bc34223bc1e2c51dff2007b3d3bd492a09b5a491 (patch) | |
tree | faa81c853389393ff0efe2f7cbea30cc0b549770 /src/include/common/file_utils.h | |
parent | bf5bb2e85b6492c7245b9446efaf43d52a98db13 (diff) | |
download | postgresql-bc34223bc1e2c51dff2007b3d3bd492a09b5a491.tar.gz postgresql-bc34223bc1e2c51dff2007b3d3bd492a09b5a491.zip |
pg_basebackup pg_receivexlog: Issue fsync more carefully
Several places weren't careful about fsyncing in the way. See 1d4a0ab1
and 606e0f98 for details about required fsyncs.
This adds a couple of functions in src/common/ that have an equivalent
in the backend: durable_rename(), fsync_parent_path()
From: Michael Paquier <michael.paquier@gmail.com>
Diffstat (limited to 'src/include/common/file_utils.h')
-rw-r--r-- | src/include/common/file_utils.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/include/common/file_utils.h b/src/include/common/file_utils.h index d3794df7a0c..1cb263d9e20 100644 --- a/src/include/common/file_utils.h +++ b/src/include/common/file_utils.h @@ -15,8 +15,11 @@ #ifndef FILE_UTILS_H #define FILE_UTILS_H -extern void fsync_fname(const char *fname, bool isdir, - const char *progname); +extern int fsync_fname(const char *fname, bool isdir, + const char *progname); extern void fsync_pgdata(const char *pg_data, const char *progname); +extern int durable_rename(const char *oldfile, const char *newfile, + const char *progname); +extern int fsync_parent_path(const char *fname, const char *progname); #endif /* FILE_UTILS_H */ |