Commit 6e3f1a9e authored by antirez's avatar antirez
Browse files

FLUSHALL now prevents rdbSave() from resetting the dirty counter, so that the...

FLUSHALL now prevents rdbSave() from resetting the dirty counter, so that the command will get replicated and put inside the AOF. This fixes issue #142
parent d12f26c2
...@@ -206,7 +206,13 @@ void flushallCommand(redisClient *c) { ...@@ -206,7 +206,13 @@ void flushallCommand(redisClient *c) {
kill(server.bgsavechildpid,SIGKILL); kill(server.bgsavechildpid,SIGKILL);
rdbRemoveTempFile(server.bgsavechildpid); rdbRemoveTempFile(server.bgsavechildpid);
} }
if (server.saveparamslen > 0) rdbSave(server.dbfilename); if (server.saveparamslen > 0) {
/* Normally rdbSave() will reset dirty, but we don't want this here
* as otherwise FLUSHALL will not be replicated nor put into the AOF. */
int saved_dirty = server.dirty;
rdbSave(server.dbfilename);
server.dirty = saved_dirty;
}
server.dirty++; server.dirty++;
} }
......
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