Commit 4c683193 authored by antirez's avatar antirez
Browse files

Use fsync instead of aof_fsync in final AOF sync.

This happens in the child process so we don't care about latency:
better to sync metadata as well.
parent f3eab7a9
...@@ -990,7 +990,7 @@ int rewriteAppendOnlyFile(char *filename) { ...@@ -990,7 +990,7 @@ int rewriteAppendOnlyFile(char *filename) {
/* Make sure data will not remain on the OS's output buffers */ /* Make sure data will not remain on the OS's output buffers */
if (fflush(fp) == EOF) goto werr; if (fflush(fp) == EOF) goto werr;
if (aof_fsync(fileno(fp)) == -1) goto werr; if (fsync(fileno(fp)) == -1) goto werr;
if (fclose(fp) == EOF) goto werr; if (fclose(fp) == EOF) goto werr;
/* Use RENAME to make sure the DB file is changed atomically only /* Use RENAME to make sure the DB file is changed atomically only
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment