Commit 682b6331 authored by Pieter Noordhuis's avatar Pieter Noordhuis Committed by antirez
Browse files

Fix AOF race that may duplicate commands

parent 6fd1a727
......@@ -795,6 +795,11 @@ void backgroundRewriteDoneHandler(int statloc) {
server.appendseldb = -1; /* Make sure SELECT is re-issued */
aofUpdateCurrentSize();
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");
......
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