diff options
author | Simon Riggs <simon@2ndQuadrant.com> | 2012-08-08 21:07:35 +0100 |
---|---|---|
committer | Simon Riggs <simon@2ndQuadrant.com> | 2012-08-08 21:07:35 +0100 |
commit | 074bef820735bcd3b7da9e5d8997e013e6115920 (patch) | |
tree | d2826869bd16c58054bf9b41525466ccbbb4ea8a | |
parent | 8a88e57ee2bd19a8be37d2726a6f21e2ee57bd2d (diff) |
fsync backup_label after pg_start_backup()
Dave Kerr, backpatched by Simon Riggs
-rw-r--r-- | src/backend/access/transam/xlog.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 47d11b945bd..88f2b394439 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -6634,7 +6634,7 @@ pg_start_backup(PG_FUNCTION_ARGS) checkpointloc.xlogid, checkpointloc.xrecoff); fprintf(fp, "START TIME: %s\n", strfbuf); fprintf(fp, "LABEL: %s\n", backupidstr); - if (fflush(fp) || ferror(fp) || FreeFile(fp)) + if (fflush(fp) || ferror(fp) || pg_fsync(fileno(fp)) != 0 || FreeFile(fp)) ereport(ERROR, (errcode_for_file_access(), errmsg("could not write file \"%s\": %m", |