Ensure slots are rechecked on EXEC.

Fixes #2515.
This commit is contained in:
Chris Thunes 2016-03-11 15:22:36 -05:00 committed by antirez
parent 91b4966783
commit d827dbfda7

View File

@ -2385,7 +2385,8 @@ int processCommand(client *c) {
!(c->flags & CLIENT_MASTER) && !(c->flags & CLIENT_MASTER) &&
!(c->flags & CLIENT_LUA && !(c->flags & CLIENT_LUA &&
server.lua_caller->flags & CLIENT_MASTER) && server.lua_caller->flags & CLIENT_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; int hashslot;
@ -2397,7 +2398,11 @@ int processCommand(client *c) {
int error_code; int error_code;
clusterNode *n = getNodeByQuery(c,c->cmd,c->argv,c->argc,&hashslot,&error_code); clusterNode *n = getNodeByQuery(c,c->cmd,c->argv,c->argc,&hashslot,&error_code);
if (n == NULL || n != server.cluster->myself) { 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); clusterRedirectClient(c,n,hashslot,error_code);
return C_OK; return C_OK;
} }