diff options
author | Chris Thunes <cthunes@brewtab.com> | 2016-03-11 15:22:36 -0500 |
---|---|---|
committer | Chris Thunes <chris.thunes@bronto.com> | 2016-03-11 15:25:48 -0500 |
commit | e0d0fb450ca70179855d189cf157b3f826561f38 (patch) | |
tree | 1a8400f7c9cf5ad77940de7b4f7a5e1364e2f297 | |
parent | 401383f1da2c47ca398d354305a8cd827665c599 (diff) | |
download | redis-e0d0fb450ca70179855d189cf157b3f826561f38.tar.gz |
Ensure slots are rechecked on EXEC.
Fixes #2515.
-rw-r--r-- | src/redis.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/redis.c b/src/redis.c index 16f2eeff6..2e6a5c951 100644 --- a/src/redis.c +++ b/src/redis.c @@ -2185,7 +2185,8 @@ int processCommand(redisClient *c) { !(c->flags & REDIS_MASTER) && !(c->flags & REDIS_LUA_CLIENT && server.lua_caller->flags & REDIS_MASTER) && - !(c->cmd->getkeys_proc == NULL && c->cmd->firstkey == 0)) + !(c->cmd->getkeys_proc == NULL && c->cmd->firstkey == 0 && + c->cmd->proc != execCommand)) { int hashslot; @@ -2197,7 +2198,11 @@ int processCommand(redisClient *c) { int error_code; clusterNode *n = getNodeByQuery(c,c->cmd,c->argv,c->argc,&hashslot,&error_code); if (n == NULL || n != server.cluster->myself) { - flagTransaction(c); + if (c->cmd->proc == execCommand) { + discardTransaction(c); + } else { + flagTransaction(c); + } clusterRedirectClient(c,n,hashslot,error_code); return REDIS_OK; } |