Use routers to fetch routing tables#280
Merged
Merged
Conversation
Collaborator
Author
|
@knutwalker this is now ready to be reviewed, we tested it against a real cluster |
Collaborator
Author
|
@knutwalker any chance to have this PR merged? |
Contributor
|
@madchicken i'll look at it next week |
knutwalker
approved these changes
Jan 14, 2026
Contributor
knutwalker
left a comment
There was a problem hiding this comment.
LGTM!
There's a small typo in a doc comment, I'll leave it to you to merge
Contributor
|
Sorry, just merged #275 and it introduced a conflict with your changes. Once rebased, you should also be getting the now updated CI builds for the status checks |
12b44dc to
0195c98
Compare
knutwalker
approved these changes
Jan 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR aims to use the list of router servers the cluster provides to fetch the routing table for a specific DB.
With these modifications we also fix the fact that when asking for the default DB the driver was not using any connection pool, but it was creating a direct connection to the main cluster URL using the provided configuration (causing the whole TLS handshacking to happen every time).
The main changes introduce the concept of a "router" server pool, update the interfaces and implementations to propagate this information, and add round-robin selection for routers. The changes also update tests and documentation accordingly.
Routing and Connection Management Enhancements:
Added support for passing and selecting a "router" (
ConnectionPool) throughout the routing and connection registry APIs, including inservers,fetch_routing_table, andget_default_dbmethods. This allows more efficient and flexible routing table fetching and server selection. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]The
RoutingTableProvidertrait and itsClusterRoutingTableProviderimplementation now accept an optional router connection pool, using it to obtain connections for routing table queries. [1] [2] [3] [4]Load Balancing Improvements:
LoadBalancingStrategytrait andRoundRobinStrategyto support router selection, including a newrouter_indexfor round-robin router selection. Added theselect_routermethod and logic to filter and sort routers for consistent selection. [1] [2] [3] [4]Documentation and API Quality:
Graphimplementation, clarifying caching and session behavior.Test Updates: