Skip to content
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

Added replica support #25

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Conversation

satish-olx
Copy link

This PR accomplishes sending the read queries to the replicas.
This is managed via specifying a read_replica_flag during the connection process, or alternatively specifying the same in the env args.
Depending on the state of the read replica flags, additional pools are maintained which connects to the replica nodes, and based on the type of queries appropriate pool is chosen and the query is sent to the node.
The query used for the replica are:
zrange
touch
zrevrangebylex
dump
zcount
hmget
hgetall
sinter
georadius_ro
exists
zrevrank
zrangebyscore
dbsize
lrange
type
zlexcount
zrank
llen
geodist
bitcount
zrangebylex
sdiff
hscan
hexists
randomkey
zrevrangebyscore
zrevrange
pttl
zcard
ttl
zscore
smembers
scan
substr
geohash
georadiusbymember_ro
geopos
getrange
strlen
sscan
hkeys
sismember
hstrlen
mget
get
srandmember
hvals
psync
sync
object
pfcount
bitpos
lindex
keys
getbit
memory
scard
zscan
hget
sunion
hlen
(I have used filtered out the readonly commands which can be obtained using the COMMANDS function in redis).
EVAL and MULTI EXEC are sent to the master by default. Also everything associate with optimistic locking transaction is sent to the master nodes.
The API's are backward compatible as you have to specify the read_replica_flag during the startup.

@adrienmo
Copy link
Owner

adrienmo commented Jan 3, 2019

Hello, @satish-olx! This is your first Pull Request that will be reviewed by Ebert, an automatic Code Review service. It will leave comments on this diff with potential issues and style violations found in the code as you push new commits. You can also see all the issues found on this Pull Request on its review page. Please check our documentation for more information.

@adrienmo
Copy link
Owner

adrienmo commented Jan 3, 2019

Ebert has finished reviewing this Pull Request and has found:

  • 1 possible new issue (including those that may have been commented here).

You can see more details about this review at https://ebertapp.io/github/adrienmo/eredis_cluster/pulls/25.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants