-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
add support for read_from_replicas in a none read_only mode #1878
Comments
@fantamiracle, I'm not sure I'm following, can you elaborate? |
It sounds kind of like something that would allow arbitrary Redis commands to read from replicas. Is that the case @fantamiracle? A feature like that might be useful to allow commands like EVAL and EVALSHA to read from replicas when the scripts do read only operations. I put up an issue for EVAL and EVALSHA here Grokzen/redis-py-cluster#480 on the redis-py-cluster repo. |
Hello @rtkefreure, EVAL/EVALSH commands have not yet been implemented in RedisCluster API because we are unable to parse the passed script to determine which node we need to run it against, if all keys belong to the same node/slot, and other cluster limitations.
However, you do need to enable readonly mode in order to run this script (see read_from_replicas=True in the RedisCluster initialization). So i'm still not clear about what you mean by reading from replicas when readonly mode is disabled. |
Hi @barshaul, thanks for the information. When you say that EVAL/EVALSHA are not yet implemented in the RedisCluster API, is that a change from redis-py-cluster? We are using EVAL commands with redis-py-cluster right now and it seems to be working fine (aside from not being able to force a script to run on a replica that we know will not do write operations). It looks like the code that determines the node/slot for the keys is here https://github.com/Grokzen/redis-py-cluster/blob/f0627c91ce23e8784dbc996078428c9bdbacb20b/rediscluster/client.py#L484-L490 For example, this seems to work fine for with redis-py-cluster:
Will this not work in redis-py with the newly added cluster support? |
It looks like something like this might allow eval to work with the redis-py cluster implementation:
|
This issue is marked stale. It will be closed in 30 days if it is not updated. |
For RedisCluster, are there plans to have a separate flag for
read_only
to supportread_from_replicas
flag for when read_only is disabled?The text was updated successfully, but these errors were encountered: