From 1ad4d31631315d0c1e140b0a831e30fa90163fec Mon Sep 17 00:00:00 2001 From: antirez Date: Wed, 26 May 2010 17:50:29 +0200 Subject: [PATCH] Fix EXEC bug that was leaving the client in dirty status when used with WATCH --- redis.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/redis.c b/redis.c index f18eabe6..def0e6b8 100644 --- a/redis.c +++ b/redis.c @@ -7556,6 +7556,7 @@ static void execCommand(redisClient *c) { execCommandReplicateMulti(c); /* Exec all the queued commands */ + unwatchAllKeys(c); /* Unwatch ASAP otherwise we'll waste CPU cycles */ orig_argv = c->argv; orig_argc = c->argc; addReplySds(c,sdscatprintf(sdsempty(),"*%d\r\n",c->mstate.count)); @@ -7568,8 +7569,7 @@ static void execCommand(redisClient *c) { c->argc = orig_argc; freeClientMultiState(c); initClientMultiState(c); - c->flags &= (~REDIS_MULTI); - unwatchAllKeys(c); + c->flags &= ~(REDIS_MULTI|REDIS_DIRTY_CAS); /* Make sure the EXEC command is always replicated / AOF, since we * always send the MULTI command (we can't know beforehand if the * next operations will contain at least a modification to the DB). */ -- 2.47.2