Skip to content

Load balancing connections among nodes of RR cluster. #6

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 1 commit into from
Jan 16, 2025

Conversation

HarshDaryani896
Copy link
Collaborator

@HarshDaryani896 HarshDaryani896 commented Jan 9, 2025

IDEA: IDEA-1330

Implementation details: Doc

The connection property load_balance currently allows only two values, viz. false (the default) and true.

It will now also allow below five new values to be specified:
only-rr - Create connections only on Read Replica nodes
only-primary- Create connections only on primary cluster nodes
prefer-rr - Create connections on Read Replica nodes. If none available, on any node in the cluster including primary cluster nodes
prefer-primary - Create connections on primary cluster nodes. If none available, on any node in the cluster including Read Replica nodes
any - Equivalent to value true. Create connections on any node in the primary or Read Replica cluster

default value is still false

Other Minor changes:

  • Corrected the behaviour of fallback_to_topology_keys_only connection property. When fallback_to_topology_keys_only is set to true and all the nodes of the specified topology_keys are down, the driver currently fallbacks to upstream driver behaviour but the driver is expected to throw an error in this case which is corrected in this PR.
  • When validating topology_keys, do not match them with the placement info of the cluster.

Testing:
Test cases identified and listed in this doc.
Test for all test cases listed in the doc added to driver-example repo: PR LINK.
Ran the existing and new tests in driver examples repo for rust-postgres.

Copy link
Collaborator

@Sfurti-yb Sfurti-yb left a comment

Choose a reason for hiding this comment

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

LGTM

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