Commit 5f54a5e6 authored by Pieter Noordhuis's avatar Pieter Noordhuis Committed by antirez
Browse files

Fix AOF race that may duplicate commands

parent 96674b6d
...@@ -766,6 +766,11 @@ void backgroundRewriteDoneHandler(int exitcode, int bysignal) { ...@@ -766,6 +766,11 @@ void backgroundRewriteDoneHandler(int exitcode, int bysignal) {
server.appendseldb = -1; /* Make sure SELECT is re-issued */ server.appendseldb = -1; /* Make sure SELECT is re-issued */
aofUpdateCurrentSize(); aofUpdateCurrentSize();
server.auto_aofrewrite_base_size = server.appendonly_current_size; server.auto_aofrewrite_base_size = server.appendonly_current_size;
/* Clear regular AOF buffer since its contents was just written to
* the new AOF from the background rewrite buffer. */
sdsfree(server.aofbuf);
server.aofbuf = sdsempty();
} }
redisLog(REDIS_NOTICE, "Background AOF rewrite successful"); redisLog(REDIS_NOTICE, "Background AOF rewrite successful");
......
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