-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Description
Thanks for wanting to report an issue you've found in redis-py. Please delete this text and fill in the template below.
It is of course not always possible to reduce your code to a small test case, but it's highly appreciated to have as much data as possible. Thank you!
Version: What redis-py and what redis version is the issue happening on?
redis-py 4.4.0, redis 7.0
Platform: What platform / version? (For example Python 3.5.1 on Windows 7 / Ubuntu 15.10 / Azure)
python 3.11.0 on Mac
Description: Description of your issue, stack traces from errors and code that reproduces the issue
Commands like EVAL_RO
and EVALSHA_RO
are always directed to the master, even though they can be routed to replicas as they are read-only commands
I suspect the cause to be READ_COMMANDS missing few read only commands
redis-py/redis/commands/cluster.py
Lines 49 to 93 in 6219574
# Not complete, but covers the major ones | |
# https://redis.io/commands | |
READ_COMMANDS = frozenset( | |
[ | |
"BITCOUNT", | |
"BITPOS", | |
"EXISTS", | |
"GEODIST", | |
"GEOHASH", | |
"GEOPOS", | |
"GEORADIUS", | |
"GEORADIUSBYMEMBER", | |
"GET", | |
"GETBIT", | |
"GETRANGE", | |
"HEXISTS", | |
"HGET", | |
"HGETALL", | |
"HKEYS", | |
"HLEN", | |
"HMGET", | |
"HSTRLEN", | |
"HVALS", | |
"KEYS", | |
"LINDEX", | |
"LLEN", | |
"LRANGE", | |
"MGET", | |
"PTTL", | |
"RANDOMKEY", | |
"SCARD", | |
"SDIFF", | |
"SINTER", | |
"SISMEMBER", | |
"SMEMBERS", | |
"SRANDMEMBER", | |
"STRLEN", | |
"SUNION", | |
"TTL", | |
"ZCARD", | |
"ZCOUNT", | |
"ZRANGE", | |
"ZSCORE", | |
] | |
) |
Can i make a PR to add those commands or is there any other rationale that prevents adding EVAL_RO and EVALSHA_RO into READ_COMMANDS?