mirror of
https://github.com/postgres/postgres.git
synced 2025-06-17 00:02:17 -04:00
fsync backup_label after pg_start_backup()
Dave Kerr, backpatched by Simon Riggs
This commit is contained in:
parent
8487d1f2e1
commit
0093b8d48a
@ -7429,7 +7429,7 @@ pg_start_backup(PG_FUNCTION_ARGS)
|
|||||||
checkpointloc.xlogid, checkpointloc.xrecoff);
|
checkpointloc.xlogid, checkpointloc.xrecoff);
|
||||||
fprintf(fp, "START TIME: %s\n", strfbuf);
|
fprintf(fp, "START TIME: %s\n", strfbuf);
|
||||||
fprintf(fp, "LABEL: %s\n", backupidstr);
|
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,
|
ereport(ERROR,
|
||||||
(errcode_for_file_access(),
|
(errcode_for_file_access(),
|
||||||
errmsg("could not write file \"%s\": %m",
|
errmsg("could not write file \"%s\": %m",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user