Commit de276b6a authored by antirez's avatar antirez
Browse files

Cluster: allow read-only EVAL/EVALSHA in slaves.

Fix #3665.
parent 522760fa
...@@ -5392,7 +5392,8 @@ clusterNode *getNodeByQuery(client *c, struct redisCommand *cmd, robj **argv, in ...@@ -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 * node is a slave and the request is about an hash slot our master
* is serving, we can reply without redirection. */ * is serving, we can reply without redirection. */
if (c->flags & CLIENT_READONLY && if (c->flags & CLIENT_READONLY &&
cmd->flags & CMD_READONLY && (cmd->flags & CMD_READONLY || cmd->proc == evalCommand ||
cmd->proc == evalShaCommand) &&
nodeIsSlave(myself) && nodeIsSlave(myself) &&
myself->slaveof == n) myself->slaveof == n)
{ {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment