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

Prepared query IDs reused between multiple hosts #249

Open
martin-sucha opened this issue Jul 1, 2022 · 0 comments
Open

Prepared query IDs reused between multiple hosts #249

martin-sucha opened this issue Jul 1, 2022 · 0 comments

Comments

@martin-sucha
Copy link
Contributor

Session.Prepare selects one connection and executes a PREPARE request on it:

https://github.com/mmatczuk/scylla-go-driver/blob/e2f94e15f879fea88870aa10af5ae7621c37f945/session.go#L148

It seems that the returned prepared statement ID is then stored in the Statement and reused in any connection.

However, prepared statement IDs may only be reused for connections to a single node, not the whole cluster:
https://github.com/apache/cassandra/blob/33a9093c5cc2f8fcf913d1931415b697e52ec108/doc/native_protocol_v4.spec#L738-L740

Kulezi added a commit that referenced this issue Aug 1, 2022
Kulezi added a commit that referenced this issue Aug 2, 2022
Kulezi added a commit that referenced this issue Aug 2, 2022
Kulezi added a commit that referenced this issue Aug 2, 2022
Also made the driver fallback from token aware policy to round robin
if both session keyspace and query keyspace are unspecified.

Fixes #249
Kulezi added a commit that referenced this issue Aug 2, 2022
Also made the driver fallback from token aware policy to round robin
if both session keyspace and query keyspace are unspecified.

Fixes #249
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

No branches or pull requests

1 participant