mirror of
http://github.com/valkey-io/valkey
synced 2024-11-22 09:17:20 +00:00
Fix AOF race that may duplicate commands
This commit is contained in:
parent
9e087a298d
commit
5d4675979d
@ -657,6 +657,11 @@ void backgroundRewriteDoneHandler(int statloc) {
|
|||||||
if (server.appendfsync != APPENDFSYNC_NO) aof_fsync(fd);
|
if (server.appendfsync != APPENDFSYNC_NO) aof_fsync(fd);
|
||||||
server.appendseldb = -1; /* Make sure it will issue SELECT */
|
server.appendseldb = -1; /* Make sure it will issue SELECT */
|
||||||
redisLog(REDIS_NOTICE,"The new append only file was selected for future appends.");
|
redisLog(REDIS_NOTICE,"The new append only file was selected for future appends.");
|
||||||
|
|
||||||
|
/* 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();
|
||||||
} else {
|
} else {
|
||||||
/* If append only is disabled we just generate a dump in this
|
/* If append only is disabled we just generate a dump in this
|
||||||
* format. Why not? */
|
* format. Why not? */
|
||||||
|
Loading…
Reference in New Issue
Block a user