From f1181b2f898a766b4f3052ee788d2ab50ad81210 Mon Sep 17 00:00:00 2001 From: "bodong.ybd" Date: Tue, 29 Aug 2023 09:58:14 +0800 Subject: [PATCH] Cluster determine slot command name need upper The judgment of the name is all uppercase, for example: L970: if command in ("EVAL", "EVALSHA"): --- redis/cluster.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/redis/cluster.py b/redis/cluster.py index cba62de077..ec4e40d7fd 100644 --- a/redis/cluster.py +++ b/redis/cluster.py @@ -956,7 +956,7 @@ def determine_slot(self, *args): determine what slots to map the command to; or, if the keys don't all map to the same key slot. """ - command = args[0] + command = args[0].upper() if self.command_flags.get(command) == SLOT_ID: # The command contains the slot ID return args[1] @@ -971,7 +971,7 @@ def determine_slot(self, *args): # command syntax: EVAL "script body" num_keys ... if len(args) <= 2: raise RedisClusterException(f"Invalid args in command: {args}") - num_actual_keys = args[2] + num_actual_keys = int(args[2]) eval_keys = args[3 : 3 + num_actual_keys] # if there are 0 keys, that means the script can be run on any node # so we can just return a random slot