We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 10c064c commit 8c46f0cCopy full SHA for 8c46f0c
src/bin/pg_basebackup/walmethods.c
@@ -611,6 +611,9 @@ tar_sync(Walfile f)
611
Assert(f != NULL);
612
tar_clear_error();
613
614
+ if (!tar_data->sync)
615
+ return 0;
616
+
617
/*
618
* Always sync the whole tarfile, because that's all we can do. This makes
619
* no sense on compressed files, so just ignore those.
@@ -842,7 +845,8 @@ tar_finish(void)
842
845
#endif
843
846
844
847
/* sync the empty blocks as well, since they're after the last file */
- fsync(tar_data->fd);
848
+ if (tar_data->sync)
849
+ fsync(tar_data->fd);
850
851
if (close(tar_data->fd) != 0)
852
return false;
0 commit comments