sherlock
sherlock copied to clipboard
Redis cluster not Compatible
When using redis cluster, keys
in lua script should be in the same slot. In current implementation, u use KEYS
for lock_name
, owner
, expire
. In most cases, they are not in the same slot, so it will raise rediscluster.exceptions.RedisClusterException: EVALSHA - all keys must map to the same key slot
if use redis-py-cluster as backend.
I think it's more reasonable to use ARGV
for owner
and expire
as they are actually not KEYS. And with ARGV
, it will be compatible to redis cluster.