From 37d650032a47bbc75356bdb09215eb6e59e363f4 Mon Sep 17 00:00:00 2001 From: antirez Date: Mon, 3 Oct 2011 15:51:10 +0200 Subject: [PATCH] Rewrite MIGRATE as DEL for AOF/replication. Also increment the dirty counter to both force replication and persistence. --- src/cluster.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/cluster.c b/src/cluster.c index 2df3cfcf..78c28a0f 100644 --- a/src/cluster.c +++ b/src/cluster.c @@ -1509,8 +1509,16 @@ void migrateCommand(redisClient *c) { addReplyErrorFormat(c,"Target instance replied with error: %s", (buf1[0] == '-') ? buf1+1 : buf2+1); } else { + robj *aux; + dbDelete(c->db,c->argv[3]); addReply(c,shared.ok); + server.dirty++; + + /* Translate MIGRATE as DEL for replication/AOF. */ + aux = createStringObject("DEL",2); + rewriteClientCommandVector(c,2,aux,c->argv[3]); + decrRefCount(aux); } }