summaryrefslogtreecommitdiff
path: root/src/server.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/server.c')
-rw-r--r--src/server.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/server.c b/src/server.c
index aeff94889..6565b0b70 100644
--- a/src/server.c
+++ b/src/server.c
@@ -2595,8 +2595,9 @@ int prepareForShutdown(int flags) {
"There is a child rewriting the AOF. Killing it!");
kill(server.aof_child_pid,SIGUSR1);
}
- /* Append only file: fsync() the AOF and exit */
+ /* Append only file: flush buffers and fsync() the AOF at exit */
serverLog(LL_NOTICE,"Calling fsync() on the AOF file.");
+ flushAppendOnlyFile(1);
aof_fsync(server.aof_fd);
}