forked from apache/cassandra-java-driver
-
Notifications
You must be signed in to change notification settings - Fork 38
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
3.x: Reconnect to original contact points #344
Merged
dkropachev
merged 1 commit into
scylladb:scylla-3.x
from
Bouncheck:scylla-3.x-reconnect-to-original-contact-points
Nov 22, 2024
Merged
3.x: Reconnect to original contact points #344
dkropachev
merged 1 commit into
scylladb:scylla-3.x
from
Bouncheck:scylla-3.x-reconnect-to-original-contact-points
Nov 22, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Bouncheck
force-pushed
the
scylla-3.x-reconnect-to-original-contact-points
branch
3 times, most recently
from
September 23, 2024 21:07
91c198f
to
0723236
Compare
I believe this should resolve #224
then with this change the driver should keep trying to reach |
Bouncheck
changed the title
Scylla 3.x reconnect to original contact points
3.x: Reconnect to original contact points
Sep 23, 2024
dkropachev
requested changes
Sep 24, 2024
driver-core/src/test/java/com/datastax/driver/core/HostResolutionReconnectionTest.java
Outdated
Show resolved
Hide resolved
driver-core/src/test/java/com/datastax/driver/core/HostResolutionReconnectionTest.java
Outdated
Show resolved
Hide resolved
driver-core/src/test/java/com/datastax/driver/core/HostResolutionReconnectionTest.java
Outdated
Show resolved
Hide resolved
dkropachev
requested changes
Sep 24, 2024
driver-core/src/test/java/com/datastax/driver/core/HostResolutionReconnectionTest.java
Outdated
Show resolved
Hide resolved
driver-core/src/test/java/com/datastax/driver/core/HostResolutionReconnectionTest.java
Outdated
Show resolved
Hide resolved
driver-core/src/test/java/com/datastax/driver/core/HostResolutionReconnectionTest.java
Outdated
Show resolved
Hide resolved
Bouncheck
force-pushed
the
scylla-3.x-reconnect-to-original-contact-points
branch
from
September 27, 2024 18:40
3bf9b5b
to
26ed1b4
Compare
When control connection tries to reconnect usually it considers only nodes provided by load balancing policy. Usually those do not include what was initially passed to the driver but the recently seen alive nodes. In some setups the IPs can keep changing so it may be useful to have an option to try initial contact points as one of the options during reconnection. Mainly if the contact point is a hostname. This change adds the option to the `QueryOptions` to control that behaviour and adds necessary logic to `ControlConnection` class. It is disabled by default, meaning that default behaviour remains unchanged. Additionally adds org.burningwave tools dependency. This dependency has features that allow for easier host resolution mocking. Adds MappedHostResolverProvider class for testing as a single entry point for controlling hostname resolution. Adds an option to CcmBridge Builder to specify cluster name. Driver checks the cluster name when reconnecting so it will refuse to reconnect to a different CcmBridge auto-generated name.
Bouncheck
force-pushed
the
scylla-3.x-reconnect-to-original-contact-points
branch
from
September 27, 2024 18:43
26ed1b4
to
8970735
Compare
Pushed v2 |
dkropachev
requested changes
Nov 5, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Bouncheck , is it ready to be shipped ? Let's fix it and merge
driver-core/src/test/java/com/datastax/driver/core/DnsEndpointTests.java
Show resolved
Hide resolved
dkropachev
approved these changes
Nov 22, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Copied from commit message:
Add option to consider initial contact points during reconnection
When control connection tries to reconnect usually it considers only nodes
provided by load balancing policy. Usually those do not include what was
initially passed to the driver but the recently seen alive nodes. In some
setups the IPs can keep changing so it may be useful to have an option to
try initial contact points as one of the options during reconnection.
Mainly if the contact point is a hostname.
This change adds the option to the
QueryOptions
to control that behaviourand adds necessary logic to
ControlConnection
class. It is disabledby default, meaning that default behaviour remains unchanged.
Additionally adds org.burningwave tools dependency.
This dependency has features that allow for easier host resolution mocking.
Adds MappedHostResolverProvider class for testing as a single entry point
for controlling hostname resolution.
Adds an option to CcmBridge Builder to specify cluster name. Driver checks the
cluster name when reconnecting so it will refuse to reconnect to a different
CcmBridge auto-generated name.