Commit a89d435d authored by antirez's avatar antirez
Browse files

Cluster: move slotToKeyFlush() to emptyDb().

This way we are sure to destroy the slot->key map every time we destroy
the DB, for instance when reloading a DB due to replication.
parent ed47f779
...@@ -178,6 +178,7 @@ long long emptyDb() { ...@@ -178,6 +178,7 @@ long long emptyDb() {
dictEmpty(server.db[j].dict); dictEmpty(server.db[j].dict);
dictEmpty(server.db[j].expires); dictEmpty(server.db[j].expires);
} }
if (server.cluster_enabled) slotToKeyFlush();
return removed; return removed;
} }
...@@ -221,7 +222,6 @@ void flushdbCommand(redisClient *c) { ...@@ -221,7 +222,6 @@ void flushdbCommand(redisClient *c) {
void flushallCommand(redisClient *c) { void flushallCommand(redisClient *c) {
signalFlushedDb(-1); signalFlushedDb(-1);
server.dirty += emptyDb(); server.dirty += emptyDb();
if (server.cluster_enabled) slotToKeyFlush();
addReply(c,shared.ok); addReply(c,shared.ok);
if (server.rdb_child_pid != -1) { if (server.rdb_child_pid != -1) {
kill(server.rdb_child_pid,SIGUSR1); kill(server.rdb_child_pid,SIGUSR1);
......
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