]> granicus.if.org Git - postgresql/commitdiff
fsync backup_label after pg_start_backup()
authorSimon Riggs <simon@2ndQuadrant.com>
Tue, 7 Aug 2012 15:20:32 +0000 (16:20 +0100)
committerSimon Riggs <simon@2ndQuadrant.com>
Tue, 7 Aug 2012 15:20:32 +0000 (16:20 +0100)
Dave Kerr

src/backend/access/transam/xlog.c

index ca6bac2d6dfe7ba90b3fdde9ca1f4fb7ad9bcddf..37c0eda510ad3d35ce2481a57ad9832fc1d98049 100644 (file)
@@ -9350,6 +9350,7 @@ do_pg_start_backup(const char *backupidstr, bool fast, char **labelfile)
                                                                BACKUP_LABEL_FILE)));
                        if (fwrite(labelfbuf.data, labelfbuf.len, 1, fp) != 1 ||
                                fflush(fp) != 0 ||
+                               pg_fsync(fileno(fp)) != 0 ||
                                ferror(fp) ||
                                FreeFile(fp))
                                ereport(ERROR,