diff options
author | antirez <antirez@gmail.com> | 2011-10-17 10:28:57 +0200 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2011-10-17 10:55:46 +0200 |
commit | 991eee4d01fd24f1d1cf0207248d41a6b254b0b8 (patch) | |
tree | 9a2d5cd004544c39cbd110692a40471970aa3a86 | |
parent | 74b77ff8a6c397602196c4dc3c5a318f93720ad7 (diff) | |
download | redis-991eee4d01fd24f1d1cf0207248d41a6b254b0b8.tar.gz |
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
-rw-r--r-- | src/db.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -180,7 +180,13 @@ void flushallCommand(redisClient *c) { kill(server.bgsavechildpid,SIGKILL); 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++; } |