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
[5/5] Add Async MultiplexedClusterConnection #640
base: main
Are you sure you want to change the base?
Conversation
c1ea5a2
to
899a863
Compare
@djc Can you do an initial review of these changes, after that I can proceed with adding tests/docs etc. |
Since this is pretty big and complex I'd like to see this split into smaller commits. Each commit should pass the tests and be formatted correctly). If you can describe it in a single bullet, it should be a single commit. Also please rebase on current main (and submit clippy fixes in a separate PR, please). |
899a863
to
02ccf07
Compare
@djc @jaymell I've rebased this PR onto main. Now we've 3 commits, each of which I think should be separated into individual PRs, after some initial reviews here. I'm not sure how I can further break down the 3 commits & also get it passing tests at the same time. |
We have a Discord channel here: https://discord.gg/WHKcJK9AKP. |
I just want to second @djc's request that we significantly break these changes down into smaller commits. The work looks promising, but we need to be very careful about lumping so many unrelated changes together. |
02ccf07
to
1af2a39
Compare
1af2a39
to
967aa4c
Compare
Hi @djc @jaymell @utkarshgupta137 Any progress in this PR ? :) |
See #653. |
- implement proper builder pattern by adding `new` & `builder` methods to ClusterClient and `new` & `build` methods to ClusterClientBuilder - deprecate & redirect `open` methods for ClusterClient & ClusterClientBuilder - move build method to ClusterClientBuilder
- this is to simplify passing multiple params to & inside ClusterConnection impl
- use plain host:port node naming, even for TLS as the tls mode/insecure flag will always be the same for all connections
- move the connect method inside impl - create new Connection directly instead of creating a Client first - convert to methods & use required params from self instead of passing - set connections within create_initial_connections & call refresh_slots
… cluster related params - remove unnecessary RefCell from params - this is to simplify passing multiple params to & inside the impl
- rename get_slots to parse_slots_response - move coverage checks & Slot creation logic into this fn - move CLUSTER SLOTS query logic out of this fn - this to easily reuse this function in the Async impl
- since we only operate in 100% slot coverage scenarios, there is no point in maintaining random connection logic, which is supposed to help us find missing nodes in the cluster topology - this also allows us to remove RefCell around connections & slots
- there is no point in using RefCell anymore
- this is to reuse the routing logic within ClusterConnection and also reuse it in async impl
…lots - set write/read timeouts just after creating connection - consolidate logic for create_initial_connections & refresh_slots connection creating/updating part into refresh_connections
- there is no point in having unnecessary indirection
- there is no point in having 2 different functions
…/supports_transactions
…pports_transactions
- remove ClusterPipeline & add re-exports for Pipeline/pipe - use `req_pipeline` instead of the packed version to avoid unpacking again for cluster - move cluster-specific pipeline checks into the new req_pipeline trait function
967aa4c
to
24f58d7
Compare
24f58d7
to
9968153
Compare
@utkarshgupta137 |
I've changed jobs & I don't use Redis anymore. I don't know the state of this crate at the moment & I'm not sure I've the bandwidth to make all the required changes. You're free to do with the PR as you like. |
Fixes #421.
This is the final PR for adding async connection support for cluster.
TODO:
P.S. I've not added support for
simple
async connections, onlymultiplexed
connections. I'm unaware of any benefits of thesimple
async connections.