projects
/
postgresql.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
10c064c
)
Don't fsync() files when --no-sync is specified
author
Magnus Hagander
<
[email protected]
>
Tue, 25 Oct 2016 16:56:21 +0000
(18:56 +0200)
committer
Magnus Hagander
<
[email protected]
>
Tue, 25 Oct 2016 17:00:01 +0000
(19:00 +0200)
Michael Paquier
src/bin/pg_basebackup/walmethods.c
patch
|
blob
|
blame
|
history
diff --git
a/src/bin/pg_basebackup/walmethods.c
b/src/bin/pg_basebackup/walmethods.c
index b0b3d435c36d3191ba1c711176a5a15a8ddba752..632e095c4e83dbd3f56a9012e282761765dafdb8 100644
(file)
--- a/
src/bin/pg_basebackup/walmethods.c
+++ b/
src/bin/pg_basebackup/walmethods.c
@@
-611,6
+611,9
@@
tar_sync(Walfile f)
Assert(f != NULL);
tar_clear_error();
+ if (!tar_data->sync)
+ return 0;
+
/*
* Always sync the whole tarfile, because that's all we can do. This makes
* no sense on compressed files, so just ignore those.
@@
-842,7
+845,8
@@
tar_finish(void)
#endif
/* sync the empty blocks as well, since they're after the last file */
- fsync(tar_data->fd);
+ if (tar_data->sync)
+ fsync(tar_data->fd);
if (close(tar_data->fd) != 0)
return false;