-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Cluster mode KEYS only searches one node by default #2560
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Oh, I'm not sure about the documentation example. I can say, though, that generally KEYS is frowned upon in production and SCAN is often the suggested replacement. That doesn't actually go towards your issue 🙃 but if you can be convinced to use SCAN, then in Grokzen/redis-py-cluster you can use In redis-py there's also a |
Hello, a year later! In any case, the current code in |
This issue is marked stale. It will be closed in 30 days if it is not updated. |
Another year later, the code remains unchanged. |
redis-py/redis/cluster.py
Line 225 in e39c7ba
The documentation provides an example:
rc.keys(target_nodes=Redis.ALL_NODES)
. This looks acceptable as a default to me.The KEYS command does not make sense in a cluster environment without checking at least the Redis.PRIMARIES.
Could KEYS either be moved to PRIMARIES/ALL_NODES or a note be added to the
Clustering
section of the documentation which explains this behaviour?In redis-py-cluster, this command was given the flag
all-nodes
: https://github.com/Grokzen/redis-py-cluster/blob/8a8102a9d758d61a7ec1e2ac9050fcd34029ff3f/rediscluster/client.py#L183As such
rc.keys("...")
breaks after switching to redis-pyThe text was updated successfully, but these errors were encountered: