Skip to content
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

Decouple load balancing logic from address set #384

Merged
merged 1 commit into from
Jul 10, 2017

Conversation

lutovich
Copy link
Contributor

@lutovich lutovich commented Jul 4, 2017

Round-robin load balancing was previously coupled with the address set implementation and made it hard to use different load balancing algorithm.

This PR turns RoundRobinAddressSet into a simple concurrent set of addresses and moves load balancing logic into a separate component that takes list of available addresses and returns one that should be used next. This allows easier implementation of new load balancing algorithms. Rediscovery procedure will now not use load balancing and query routers in a known order (which is randomized by the database).

Round-robin load balancing was previously coupled with the address
set implementation and made it hard to use different load balancing
algorithm.

This commit turns RoundRobinAddressSet into a simple concurrent set of
addresses and moves load balancing logic into a separate component that
takes list of available addresses and returns one that should be used
next. This allows easier implementation of new load balancing
algorithms. Rediscovery procedure will now not use load balancing and
query routers in a known order (which is randomized by the database).
Copy link
Contributor

@ali-ince ali-ince left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good. Very minor and not related with this change, it seems that the synchronized keywords in ClusterRoutingTable#update and ClusterRoutingTable#forget can be removed as those are called through LoadBalancer#refreshRouting's logic.

@zhenlineo zhenlineo merged commit ab54cc5 into neo4j:1.5 Jul 10, 2017
@lutovich lutovich deleted the 1.5-load-balancing-infra branch July 10, 2017 08:46
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.

3 participants