From 6984692060106de666ee89d092163075282c6498 Mon Sep 17 00:00:00 2001 From: antirez Date: Fri, 7 Mar 2014 16:18:00 +0100 Subject: [PATCH] Cluster: fix conditional generating TRYAGAIN error. --- src/cluster.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/cluster.c b/src/cluster.c index 0edfe0e27ac..c99f1fa8e39 100644 --- a/src/cluster.c +++ b/src/cluster.c @@ -3939,13 +3939,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 {