Skip to content
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: Adjust for zero token nodes #399

Draft
wants to merge 1 commit into
base: scylla-3.x
Choose a base branch
from

Conversation

Bouncheck
Copy link
Collaborator

@Bouncheck Bouncheck commented Dec 9, 2024

Adds ZeroTokenNodesIT that checks the behaviour of the driver when zero-token
nodes are involved.

Changes behavior of the driver in regards to zero-token nodes. Those nodes
will be ignored if encountered in system.peers table. If provided as a
contact point, the driver will attempt to connect to it, but will not populate
metadata with it. This results in zero-token nodes being not included in
query planning.

Note that the isValidPeer method had the check for nullity of tokens column
moved from extended peer check to the regular check.

@Bouncheck Bouncheck requested a review from dkropachev December 9, 2024 21:00
@Bouncheck Bouncheck self-assigned this Dec 9, 2024
Copy link
Collaborator

@dkropachev dkropachev left a comment

Choose a reason for hiding this comment

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

@Bouncheck , thanks, looks good, could you please add another test for Zero-token Datacenter from #317

@dkropachev
Copy link
Collaborator

@Bouncheck , please consider fixing code not to log following error:

WARN  [cluster1-worker-2] 2024-09-17 16:10:28,825 ReplicationStategy.java:204 - Error while computing token map for keyspace keyspace1 with datacenter eu-northscylla_node_north: could not achieve replication factor 3 (found 0 replicas only), check your keyspace replication settings.

@Bouncheck Bouncheck force-pushed the scylla-3.x-zero-token-ITs branch from 58d2072 to a557147 Compare December 12, 2024 10:11
@Bouncheck Bouncheck changed the title 3.x: Add integration test for zero token nodes 3.x: Adjust for zero token nodes Dec 12, 2024
@Bouncheck Bouncheck force-pushed the scylla-3.x-zero-token-ITs branch from a557147 to 1b13045 Compare December 12, 2024 10:15
@Bouncheck
Copy link
Collaborator Author

Added some tests. The current version slightly differs from what's proposed in #317 , for example driver won't fail when executing queries after connecting to zero-token DC. It just won't direct queries to it.

@Bouncheck
Copy link
Collaborator Author

Bouncheck commented Dec 12, 2024

@Bouncheck , please consider fixing code not to log following error:

WARN  [cluster1-worker-2] 2024-09-17 16:10:28,825 ReplicationStategy.java:204 - Error while computing token map for keyspace keyspace1 with datacenter eu-northscylla_node_north: could not achieve replication factor 3 (found 0 replicas only), check your keyspace replication settings.

In one of the tests i create a table in a new keyspace with general replication_factor in multi-dc setting and I do not see this error now.

@Bouncheck
Copy link
Collaborator Author

Some of the tests fail, because their hosts have null tokens but are not meant to be treated as zero-token nodes. This needs more or different adjustments.

@Bouncheck Bouncheck marked this pull request as draft December 12, 2024 10:52
Adds ZeroTokenNodesIT that checks the behaviour of the driver when zero-token
nodes are involved.

Changes behavior of the driver in regards to zero-token nodes. Those nodes
will be ignored if encountered in `system.peers` table. If provided as a
contact point, the driver will attempt to connect to it, but will not populate
metadata with it. This results in zero-token nodes being not included in
query planning.

Note that the `isValidPeer` method had the check for nullity of `tokens` column
moved from extended peer check to the regular check.
@Bouncheck Bouncheck force-pushed the scylla-3.x-zero-token-ITs branch from 1b13045 to c96f87b Compare December 13, 2024 11:17
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