summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Thunes <cthunes@brewtab.com>2016-03-11 15:22:36 -0500
committerChris Thunes <chris.thunes@bronto.com>2016-03-11 15:25:48 -0500
commite0d0fb450ca70179855d189cf157b3f826561f38 (patch)
tree1a8400f7c9cf5ad77940de7b4f7a5e1364e2f297
parent401383f1da2c47ca398d354305a8cd827665c599 (diff)
downloadredis-e0d0fb450ca70179855d189cf157b3f826561f38.tar.gz
Ensure slots are rechecked on EXEC.
Fixes #2515.
-rw-r--r--src/redis.c9
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;
}