[#26004] Make load-balance property configurable #171
Merged
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.
Description
Currently the
load-balance
property in connection URL is hardcoded to true for Multi host pattern. We do not mention any value to this property for single host pattern and as a result it always defaults to false.This PR makes this property configurable via a connector config. A new connector config
yb.load.balance.connections
has been introduced which determines the value ofload-balance
property in the connection URL. When set to true, the driver fetches and maintains a list of nodes from the given endpoint (even when a single hostname is provided in the config) in the universe and distributes the connections equally across these nodes.The default value of
yb.load.balance.connections
is true. We may want to set this to false while testing scenarios where we want to have imbalance of replication connections (walsenders) across nodes.Testing
Manually tested out by toggling the values of this config and providing single host name in the connector config with a 3 node universe.