Skip to content

Commit c0751d3

Browse files
fsync backup_label after pg_start_backup()
Dave Kerr, backpatched by Simon Riggs
1 parent 8fb54e9 commit c0751d3

File tree

1 file changed

+1
-1
lines changed
  • src/backend/access/transam

1 file changed

+1
-1
lines changed

src/backend/access/transam/xlog.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8546,7 +8546,7 @@ pg_start_backup(PG_FUNCTION_ARGS)
85468546
checkpointloc.xlogid, checkpointloc.xrecoff);
85478547
fprintf(fp, "START TIME: %s\n", strfbuf);
85488548
fprintf(fp, "LABEL: %s\n", backupidstr);
8549-
if (fflush(fp) || ferror(fp) || FreeFile(fp))
8549+
if (fflush(fp) || ferror(fp) || pg_fsync(fileno(fp)) != 0 || FreeFile(fp))
85508550
ereport(ERROR,
85518551
(errcode_for_file_access(),
85528552
errmsg("could not write file \"%s\": %m",

0 commit comments

Comments
 (0)