diff options
| author | Simon Riggs <simon@2ndQuadrant.com> | 2012-08-07 16:22:58 +0100 |
|---|---|---|
| committer | Simon Riggs <simon@2ndQuadrant.com> | 2012-08-07 16:22:58 +0100 |
| commit | c0751d323e96fcaaecba289b71970388972ee608 (patch) | |
| tree | 93d1541d92a6d4bfd2e472bc053a6e21547e75e0 /src | |
| parent | 8fb54e91b3b5ff2f73039cc1ba9b0c2d9022418e (diff) | |
fsync backup_label after pg_start_backup()
Dave Kerr, backpatched by Simon Riggs
Diffstat (limited to 'src')
| -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 0cab155fcfa..9a9b04f2422 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -8546,7 +8546,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", |
