mirror of
https://github.com/fluencelabs/redis
synced 2025-03-22 10:30:49 +00:00
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.
This commit is contained in:
parent
ed47f77977
commit
a89d435d8e
2
src/db.c
2
src/db.c
@ -178,6 +178,7 @@ long long emptyDb() {
|
||||
dictEmpty(server.db[j].dict);
|
||||
dictEmpty(server.db[j].expires);
|
||||
}
|
||||
if (server.cluster_enabled) slotToKeyFlush();
|
||||
return removed;
|
||||
}
|
||||
|
||||
@ -221,7 +222,6 @@ void flushdbCommand(redisClient *c) {
|
||||
void flushallCommand(redisClient *c) {
|
||||
signalFlushedDb(-1);
|
||||
server.dirty += emptyDb();
|
||||
if (server.cluster_enabled) slotToKeyFlush();
|
||||
addReply(c,shared.ok);
|
||||
if (server.rdb_child_pid != -1) {
|
||||
kill(server.rdb_child_pid,SIGUSR1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user