From de276b6a439179b3cd0c94df82729cae8ab1cb9a Mon Sep 17 00:00:00 2001 From: antirez Date: Wed, 13 Dec 2017 13:35:59 +0100 Subject: [PATCH] Cluster: allow read-only EVAL/EVALSHA in slaves. Fix #3665. --- src/cluster.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cluster.c b/src/cluster.c index 6f7f982f..a5ecf84c 100644 --- a/src/cluster.c +++ b/src/cluster.c @@ -5392,7 +5392,8 @@ clusterNode *getNodeByQuery(client *c, struct redisCommand *cmd, robj **argv, in * node is a slave and the request is about an hash slot our master * is serving, we can reply without redirection. */ if (c->flags & CLIENT_READONLY && - cmd->flags & CMD_READONLY && + (cmd->flags & CMD_READONLY || cmd->proc == evalCommand || + cmd->proc == evalShaCommand) && nodeIsSlave(myself) && myself->slaveof == n) {