-
Notifications
You must be signed in to change notification settings - Fork 59
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
Client side routing implementation #205
base: main
Are you sure you want to change the base?
Conversation
Hey, thanks for this PR, this helps a lot! I went over the changes and don't have anything to add, but I also did look in detail at the actual routing protocol and algorithms. I'm ok with merging something before dealing with all limitations. In particular, I think it's fine to not support the routing context, bookmarks, only have partial 4.3 support, only having one routing strategy at the beginning. We don't need to have everything figured out upfront and can do this in steps/multiple PRs. I've been thinking about the testing a bit (or a lot) lately; I don't like the amount of integration tests compared to what the unit tests do. Especially when testing bolt protocol details of a non-happy path, it can be either impossible or very difficult to setup. I have half an idea to rewrite the core parts with the connection IO and pooling being abstracted out. I would like to be able to do more simulation testing where exact IO operations can be simulated in the tests without having to have an actual db to setup. I'd also like to move async out from the core to some outer layer. Maybe this goes in the sans-io direction, maybe it'll look a bit different. |
Thanks for the reply @knutwalker, I will remove the implementation of the client-side routing for the stable protocol and leave it only when the |
2184948
to
a8904a9
Compare
…-v2 feature Formatting
great!
There shouldn't be a need for any scheme. The first connection uses the scheme to determine the initial routing and the encryption to use. When connecting to a server from the routing table, you use the same encryption settings (and, when supported, routing context) and directly connect to that socket address, without going through the bolt/neo4j scheme parsing again. That is what the product drivers do, at least. That looks like this requires some changes to the pool creation, essentially using the same ConnectionInfo, but with only the host/port replaced. |
Yes, sorry...I realized that too. |
5eacd78
to
abf4dd8
Compare
@knutwalker please take a look at my last commit where I had to modify the main Graph interface. I had essentially to expose the |
…ion to perform (read or write)
abf4dd8
to
98bc0ce
Compare
…and use slices to select the right server
…ey have multiple addresses) - When creating the pool, use the common config but change the uri with the resolved server one
This PR is a draft implementation of the client-side routing for new4j clusters.
The PR implements the ROUTE message for both the stable bolt implementation and the unstable one. Tests are being performed on the stable version of the protocol since the new one is still giving me problems in deserialization.
What the PR is still missing:
- [ ] Bookmarks are not supported at the moment (the array is always sent empty)imp_user
should be added to the transaction begin message)- [ ] Only the round-robin algorithm is currently implemented as a routing strategy. Maybe we want to implement a LeastUsed algo and make it configurable.- [ ] There is no handling of the initial routing context: it is always empty.Additional Notes:
- Extra fields in the route message are not implemented yet (part of v4.4)Protocol version is now 4.4