-
Notifications
You must be signed in to change notification settings - Fork 623
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
Token aware host policy chooses primary replicas only #1621
Labels
Comments
Hi! I haven't tried to reproduce yet, but indeed this seems like a bug. Thanks for reporting it! |
fruch
added a commit
to fruch/scylla-bench
that referenced
this issue
Jun 27, 2022
Seem what's described in apache/cassandra-gocql-driver#1621 might be affecting us, and making scylla-bench send unblanced traffic to scylla REF: apache/cassandra-gocql-driver#1621
fruch
added a commit
to fruch/scylla-cluster-tests
that referenced
this issue
Jun 27, 2022
…ndra-gocql-driver#1621 Try those fixes to see if with them we get more balenced traffic Ref: https://github.com/fruch/scylla-bench/tree/work_around_gocql_1621 Ref: apache/cassandra-gocql-driver#1621
This was referenced Jun 30, 2022
fruch
added a commit
to fruch/scylla-bench
that referenced
this issue
Sep 1, 2022
Seem what's described in apache/cassandra-gocql-driver#1621 might be affecting us, and making scylla-bench send unblanced traffic to scylla REF: apache/cassandra-gocql-driver#1621
fruch
added a commit
to fruch/scylla-bench
that referenced
this issue
Sep 1, 2022
Seem what's described in apache/cassandra-gocql-driver#1621 might be affecting us, and making scylla-bench send unblanced traffic to scylla REF: apache/cassandra-gocql-driver#1621
roydahan
pushed a commit
to scylladb/scylla-bench
that referenced
this issue
Sep 4, 2022
Seem what's described in apache/cassandra-gocql-driver#1621 might be affecting us, and making scylla-bench send unblanced traffic to scylla REF: apache/cassandra-gocql-driver#1621
sylwiaszunejko
added a commit
to sylwiaszunejko/gocql
that referenced
this issue
Jul 12, 2023
Previously TokenAwarePolicy always used Keyspace explicitly set in cluster.Keyspace regardless of the keyspace in the Query. Now after preparing statement Keyspace and Table names are transferred to the Query and it can make use of that. Fixes: apache#1621
sylwiaszunejko
added a commit
to sylwiaszunejko/gocql
that referenced
this issue
Jul 14, 2023
Previously TokenAwarePolicy always used Keyspace explicitly set in cluster.Keyspace regardless of the keyspace in the Query. Now after preparing statement Keyspace and Table names are transferred to the Query and it can make use of that. Fixes: apache#1621
sylwiaszunejko
added a commit
to sylwiaszunejko/gocql
that referenced
this issue
Jul 14, 2023
Previously TokenAwarePolicy always used Keyspace explicitly set in cluster.Keyspace regardless of the keyspace in the Query. Now after preparing statement Keyspace and Table names are transferred to the Query and it can make use of that. Fixes: apache#1621
sylwiaszunejko
added a commit
to sylwiaszunejko/gocql
that referenced
this issue
Jul 14, 2023
Previously TokenAwarePolicy always used Keyspace explicitly set in cluster.Keyspace regardless of the keyspace in the Query. Now after preparing statement Keyspace and Table names are transferred to the Query and it can make use of that. Fixes: apache#1621
sylwiaszunejko
added a commit
to sylwiaszunejko/gocql
that referenced
this issue
Jul 14, 2023
Previously TokenAwarePolicy always used Keyspace explicitly set in cluster.Keyspace regardless of the keyspace in the Query. Now after preparing statement Keyspace and Table names are transferred to the Query and it can make use of that. Fixes: apache#1621
sylwiaszunejko
added a commit
to sylwiaszunejko/gocql
that referenced
this issue
Jul 17, 2023
Previously TokenAwarePolicy always used Keyspace explicitly set in cluster.Keyspace regardless of the keyspace in the Query. Now after preparing statement Keyspace and Table names are transferred to the Query and it can make use of that. Fixes: apache#1621
sylwiaszunejko
added a commit
to sylwiaszunejko/gocql
that referenced
this issue
Jul 17, 2023
Previously TokenAwarePolicy always used Keyspace explicitly set in cluster.Keyspace regardless of the keyspace in the Query. Now after preparing statement Keyspace and Table names are transferred to the Query and it can make use of that. Fixes: apache#1621
sylwiaszunejko
added a commit
to sylwiaszunejko/gocql
that referenced
this issue
Jul 21, 2023
Previously TokenAwarePolicy always used Keyspace explicitly set in cluster.Keyspace regardless of the keyspace in the Query. Now after preparing statement Keyspace and Table names are transferred to the Query and it can make use of that. Fixes: apache#1621
sylwiaszunejko
added a commit
to sylwiaszunejko/scylla-bench
that referenced
this issue
Aug 9, 2023
Setting the keyspace explicitly was done to workaround the following bug: apache/cassandra-gocql-driver#1621 After fixing this bug it is not necessary anymore. (PR fixing it: apache/cassandra-gocql-driver#1714)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If no keyspace is specified in ClusterConfig, then the token aware host policy has a degraded functionality.
What version of Gocql are you using?
master
What did you do?
I did not specify
.Keyspace
inClusterConfig
and usedgocql.TokenAwareHostPolicy(gocql.RoundRobinHostPolicy(), gocql.ShuffleReplicas())
as an host selection policy. I then run a few SELECT queries against a 3 node cluster.What did you expect to see?
I expected each of 3 nodes to receive some queries.
What did you see instead?
Only the primary replica received the select queries (even though I was operating on a 3-node cluster, on a keyspace with replication factor 3 and passed
gocql.ShuffleReplicas()
toTokenAwareHostPolicy)
.More
This issue persists if the
.Keyspace
field is not equal to a keyspace directly specified in a query string. For example:The root of this problem is the way that
tokenAwareHostPolicy
manages replica maps for keyspaces.When a
Pick
method oftokenAwareHostPolicy
is invoked, replica hosts are chosen using previously build replica maps. Because replica maps are only* built for keyspace returned bytokenAwareHostPolicy.getKeyspaceName()
, this codepath is triggered resulting in a selection of a primary replica only.* they are also build when a
KeyspaceUpdateEvent
is received by the policy. I haven't observed any of those events during my tests.Sending every query to its primary replica can cause unequal load in a cluster. I did not find any records of this behavior in the documentation, so I'm considering it a bug.
The text was updated successfully, but these errors were encountered: