summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSalvatore Sanfilippo <antirez@gmail.com>2017-09-18 12:03:41 +0200
committerGitHub <noreply@github.com>2017-09-18 12:03:41 +0200
commit8885921dfbdd5fee2d5904f6f296435f038f45e1 (patch)
treef8a895587c22ff12b37a43fe8b82c3caca66abe5
parent202c2ebec4d47d6f8cfbb6c91dd4486dd62aebf6 (diff)
parentb122cadc666054ea83c699d65b518dc0f6f633c0 (diff)
downloadredis-8885921dfbdd5fee2d5904f6f296435f038f45e1.tar.gz
Merge pull request #4311 from oranagra/aof_shutdown_flush
Flush append only buffers before existing.
-rw-r--r--src/server.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/server.c b/src/server.c
index ef05f055d..312b95048 100644
--- a/src/server.c
+++ b/src/server.c
@@ -2536,8 +2536,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);
}