From f7f77a746ab458566654dc159925528daaaf80da Mon Sep 17 00:00:00 2001 From: WuYunlong Date: Tue, 21 Jul 2020 14:41:44 +0800 Subject: 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. --- src/server.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; -- cgit v1.2.1