Load balancing connections among nodes of RR cluster. #6
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.
IDEA: IDEA-1330
Implementation details: Doc
The connection property
load_balance
currently allows only two values, viz.false
(the default) andtrue
.It will now also allow below five new values to be specified:
only-rr
- Create connections only on Read Replica nodesonly-primary
- Create connections only on primary cluster nodesprefer-rr
- Create connections on Read Replica nodes. If none available, on any node in the cluster including primary cluster nodesprefer-primary
- Create connections on primary cluster nodes. If none available, on any node in the cluster including Read Replica nodesany
- Equivalent to value true. Create connections on any node in the primary or Read Replica clusterdefault value is still
false
Other Minor changes:
fallback_to_topology_keys_only
connection property. Whenfallback_to_topology_keys_only
is set totrue
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.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.