mirror of
https://github.com/postgres/postgres.git
synced 2025-11-09 06:21:09 +03:00
pg_basebackup: Skip a few more fsyncs if --no-sync is specified.
This is mostly interesting for running the regression tests on machines with slow / overloaded IO. Discussion: https://postgr.es/m/20220119041646.rhuo3youiqxqjmo2@alap3.anarazel.de
This commit is contained in:
@@ -2201,9 +2201,21 @@ BaseBackup(void)
|
||||
snprintf(tmp_filename, MAXPGPATH, "%s/backup_manifest.tmp", basedir);
|
||||
snprintf(filename, MAXPGPATH, "%s/backup_manifest", basedir);
|
||||
|
||||
/* durable_rename emits its own log message in case of failure */
|
||||
if (durable_rename(tmp_filename, filename) != 0)
|
||||
exit(1);
|
||||
if (do_sync)
|
||||
{
|
||||
/* durable_rename emits its own log message in case of failure */
|
||||
if (durable_rename(tmp_filename, filename) != 0)
|
||||
exit(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (rename(tmp_filename, filename) != 0)
|
||||
{
|
||||
pg_log_error("could not rename file \"%s\" to \"%s\": %m",
|
||||
tmp_filename, filename);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (verbose)
|
||||
|
||||
Reference in New Issue
Block a user