1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-08 11:42:09 +03:00

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>
This commit is contained in:
Peter Eisentraut
2016-09-29 12:00:00 -04:00
parent bf5bb2e85b
commit bc34223bc1
4 changed files with 164 additions and 31 deletions

View File

@ -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 */