-
Notifications
You must be signed in to change notification settings - Fork 616
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
Cluster: Create read_from_replicas option #635
Cluster: Create read_from_replicas option #635
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sounds good, pretty simple!
- send write queries to primaries & read queries to replicas in read_from_replicas mode - deprecate the readonly param in favour of the new read_from_replicas param
e4f2914
to
ec2a3d1
Compare
6020995
to
a36310f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems reasonable to me!
is_zero was added in rust 1.53
Looks great, merged! I'm wondering if it's worth dynamically getting the |
Send write queries to primaries & read queries to replicas in `read_from_replicas` mode; deprecate the `readonly` param in favour of the new `read_from_replicas` param.
Send write queries to primaries & read queries to replicas in `read_from_replicas` mode; deprecate the `readonly` param in favour of the new `read_from_replicas` param.
Send write queries to primaries & read queries to replicas in `read_from_replicas` mode; deprecate the `readonly` param in favour of the new `read_from_replicas` param.
Send write queries to primaries & read queries to replicas in `read_from_replicas` mode; deprecate the `readonly` param in favour of the new `read_from_replicas` param.
Currently, all cluster commands in readonly mode first go to the replica & then in case of errors, they're redirected to the primary.
Instead of the unnecessary replica call & then creating a connection, we can check if a command is readonly or not & then set it to the appropriate node.
This results in a benchmark improvement of ~80% for write commands in readonly mode.
IMO, the option should be renamed from
readonly
toread_from_replicas
, but that would create a breaking change.