diff options
author | Simon Riggs | 2012-08-08 20:06:05 +0000 |
---|---|---|
committer | Simon Riggs | 2012-08-08 20:06:05 +0000 |
commit | 0093b8d48af1c512efa1c90c487a78cad92bed56 (patch) | |
tree | 326842bcd12fab888b48938f72fed425130a276b | |
parent | 8487d1f2e14ef7b776ba8e986a3f4816bcc94e4b (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 b8df42567d2..b8ca6857afb 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -7429,7 +7429,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", |