summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWuYunlong <xzsyeb@126.com>2020-07-21 14:41:44 +0800
committerGitHub <noreply@github.com>2020-07-21 09:41:44 +0300
commitf7f77a746ab458566654dc159925528daaaf80da (patch)
tree2cbbabe541e7ed34ffdc5247d9e872d74dd3432b
parent3f2fbc4c614ff718dce7d55fd971d7ed36062c24 (diff)
downloadredis-f7f77a746ab458566654dc159925528daaaf80da.tar.gz
Clarification on the bug that was fixed in PR #7539. (#7541)
Before that PR, processCommand() did not notice that cmd could be a module command in which case getkeys_proc member has a different meaning. The outcome was that a module command which doesn't take any key names in its arguments (similar to SLOWLOG) would be handled as if it might have key name arguments (similar to MEMORY), would consider cluster redirect but will end up with 0 keys after an excessive call to getKeysFromCommand, and eventually do the right thing.
-rw-r--r--src/server.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/server.c b/src/server.c
index eee3391d9..d984a7edc 100644
--- a/src/server.c
+++ b/src/server.c
@@ -3430,7 +3430,8 @@ void rejectCommandFormat(client *c, const char *fmt, ...) {
sdsfree(s);
}
-/* A command that uses keys but has no pre-determined key position arguments. */
+/* Returns 1 for commands that may have key names in their arguments, but have
+ * no pre-determined key positions. */
static int cmdHasMovableKeys(struct redisCommand *cmd) {
return (cmd->getkeys_proc && !(cmd->flags & CMD_MODULE)) ||
cmd->flags & CMD_MODULE_GETKEYS;