Skip to content

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

Merged
merged 16 commits into from
Jul 9, 2025

Conversation

madchicken
Copy link
Collaborator

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 optional db 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: Enhanced RoutedConnectionManager 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:

TLS configuration updates:

  • lib/src/connection.rs: Simplified TLS configuration logic by removing redundant warnings and restructuring the ClientConfig initialization process. [1] [2]

Routing table provider updates:

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.

Copy link
Collaborator

@knutwalker knutwalker left a 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!

@knutwalker
Copy link
Collaborator

Gonna try to draft and undraft to kick off a new CI run, I don't have the approve button anymore

@knutwalker knutwalker marked this pull request as draft July 7, 2025 13:51
@knutwalker knutwalker marked this pull request as ready for review July 7, 2025 13:51
@knutwalker
Copy link
Collaborator

ok, that didn't work… @madchicken could you push some change or a rebase?

@madchicken
Copy link
Collaborator Author

@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.

@madchicken madchicken requested a review from knutwalker July 8, 2025 12:13
Copy link
Collaborator

@knutwalker knutwalker left a 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

@madchicken
Copy link
Collaborator Author

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

@madchicken madchicken merged commit 6748145 into neo4j-labs:main Jul 9, 2025
11 checks passed
@madchicken madchicken deleted the multi-rt branch July 9, 2025 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants