Support a case when the cluster could be behind a load-balancer #41
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.
The driver expects direct access to all the nodes in a YugabyteDB cluster.
We have seen some users use the cluster through an external load-balancer.
While it is not a recommended practice, the driver still functions but with less efficiency and a hampered retry policy.
This change aims to address a case which cannot be handled through a custom
RetryPolicy
.If a request fails during a
send
to a node, AND the query-plan for the request does not have any other nodes AND if the node still has some connections, then retrysend
one more time.This should not cause any perf impact since it is retry-once in a rare case, in a non-LB setup.
Changes in
PartitionAwarePolicy
are purely formatting related.Testing
This was tested manually through an app connecting to a YB Managed cluster.
No unit test possible since it involves external load-balancer.