mirror of
https://github.com/fluencelabs/redis
synced 2025-03-19 17:10:50 +00:00
Flush append only buffers before existing.
when SHUTDOWN command is recived it is possible that some of the recent command were not yet flushed from the AOF buffer, and the server experiences data loss at shutdown.
This commit is contained in:
parent
202c2ebec4
commit
b122cadc66
@ -2536,8 +2536,9 @@ int prepareForShutdown(int flags) {
|
|||||||
"There is a child rewriting the AOF. Killing it!");
|
"There is a child rewriting the AOF. Killing it!");
|
||||||
kill(server.aof_child_pid,SIGUSR1);
|
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.");
|
serverLog(LL_NOTICE,"Calling fsync() on the AOF file.");
|
||||||
|
flushAppendOnlyFile(1);
|
||||||
aof_fsync(server.aof_fd);
|
aof_fsync(server.aof_fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user