Skip to content

Commit

Permalink
Cluster: fix conditional generating TRYAGAIN error.
Browse files Browse the repository at this point in the history
  • Loading branch information
antirez committed Mar 7, 2014
1 parent 36676c2 commit 6984692
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/cluster.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 6984692

Please sign in to comment.