diff options
author | antirez <antirez@gmail.com> | 2014-03-07 16:18:00 +0100 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2014-03-11 11:10:09 +0100 |
commit | afe28cfd75f197952cb3c2f7a08ef9f694a7a5fd (patch) | |
tree | 1039110dc0fc9329d1c736cea4ba703d4950d5ef | |
parent | aa5898f53eff5dad018399e106dfb54a8b695b73 (diff) | |
download | redis-afe28cfd75f197952cb3c2f7a08ef9f694a7a5fd.tar.gz |
Cluster: fix conditional generating TRYAGAIN error.
-rw-r--r-- | src/cluster.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/cluster.c b/src/cluster.c index ede1123c1..11b50a22e 100644 --- a/src/cluster.c +++ b/src/cluster.c @@ -3957,13 +3957,14 @@ clusterNode *getNodeByQuery(redisClient *c, struct redisCommand *cmd, robj **arg return server.cluster->migrating_slots_to[slot]; } - /* If we are receiving the slot, we have all the keys, and the client - * correctly flagged the request as "ASKING", we can serve - * the request, otherwise the only option is to send a TRYAGAIN error. */ + /* If we are receiving the slot, and the client correctly flagged the + * request as "ASKING", we can serve the request. However if the request + * involves multiple keys and we don't have them all, the only option is + * to send a TRYAGAIN error. */ if (importing_slot && (c->flags & REDIS_ASKING || cmd->flags & REDIS_CMD_ASKING)) { - if (missing_keys) { + if (multiple_keys && missing_keys) { if (error_code) *error_code = REDIS_CLUSTER_REDIR_UNSTABLE; return NULL; } else { |