-
Notifications
You must be signed in to change notification settings - Fork 68
Support multiple routing tables (one per database) #244
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
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.
looks good, thank you for the contribution!
Gonna try to draft and undraft to kick off a new CI run, I don't have the approve button anymore |
ok, that didn't work… @madchicken could you push some change or a rebase? |
@knutwalker I will. I just discovered that one of the tests I wrote is flaky, because of the async nature of the connection registry. I will push a fix as soon as possible. |
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.
Thanks! I imagine it's gonna conflict with #248 because of the backoff/backon refactor
… for routing tables different from the one used in the connect configuration
Please @knutwalker wait a sec before merging, we are testing it after the rebase, I just want to do a smoke test on a real env |
This PR adds support for multi-database connections, so each database has its own routing table saved (and refreshed) on the driver side. It introduces significant enhancements to the connection management and routing logic in the codebase.
It also updates to TLS configuration handling (only load certificates if needed).
Database-specific routing and connection management:
lib/src/graph.rs
: Updated methods to include an optionaldb
parameter for database-specific connection retrieval. This ensures operations can target specific databases when required. [1] [2] [3] [4]lib/src/routing/routed_connection_manager.rs
: EnhancedRoutedConnectionManager
to support database-specific routing tables and connections. Added logic to refresh routing tables dynamically when empty and introduced a maximum wait time for routing table updates. [1] [2] [3] [4]Load-balancing strategy improvements:
lib/src/routing/load_balancing/round_robin_strategy.rs
: RefactoredRoundRobinStrategy
to utilize aConnectionRegistry
for tracking all servers. Improved the selection logic to handle scenarios where servers are unavailable or have been used. Updated tests to validate the new behavior. [1] [2] [3] [4]TLS configuration updates:
lib/src/connection.rs
: Simplified TLS configuration logic by removing redundant warnings and restructuring theClientConfig
initialization process. [1] [2]Routing table provider updates:
lib/src/routing/routing_table_provider.rs
: Extended theRoutingTableProvider
trait and its implementation to support database-specific routing table retrieval. This aligns with the changes in connection management. [1] [2] [3]Logging and diagnostics improvements:
lib/src/pool.rs
: Enhanced logging to include the node URI when creating connection pools, providing better visibility into pool initialization.