-
Notifications
You must be signed in to change notification settings - Fork 622
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
CASSGO-26 Impossible to set CONSISTENCY SERIAL (select consistency) #1832
Comments
@danthegoodman1 , have you tried |
@dkropachev sorry I was inspecting this issue more at the package level, it seems like they support it https://github.com/scylladb/gocql/blob/master/frame.go#L187-L188 but this package does not (which is strange, considering cassandra supports it: https://docs.datastax.com/en/cql/hcd-1.0/reference/cqlsh-commands/consistency.html#setting-a-consistency-level) |
@danthegoodman1 according to gocql documentation (for batch: https://pkg.go.dev/github.com/gocql/gocql#Batch.SerialConsistency, for query: https://pkg.go.dev/github.com/gocql/gocql#Query.SerialConsistency) the SerialConsistency supports only conditional update/insert operations. I will test if it works this way. |
And if so, the problem is there becomes no way to use that Cassandra feature in this package then. |
@danthegoodman1 I have tested it and compared behavior with the Python driver as well as cqlsh and ensured that everything works according to the documentation (https://github.com/apache/cassandra/blob/trunk/doc/native_protocol_v5.spec). To set SERIAL consistency you can do the following cluster := gocql.NewCluster("***.**.*.*:****")
cluster.Keyspace = "test"
cluster.SerialConsistency = gocql.Serial or directly to query
It will set the SERIAL consistency level for the serial phase of conditional updates.
|
Not the Subtle difference, but |
@danthegoodman1 sorry for the misunderstanding, now I see the problem. Inspired by (https://github.com/scylladb/gocql/blob/master/frame.go#L187-L188) I added this feature, and now it should work properly. |
Thank you! |
Please answer these questions before submitting your issue. Thanks!
What version of Cassandra are you using?
ScyllaDB
What version of Gocql are you using?
1.7.0
What version of Go are you using?
1.22.5
The
.Consistency
options don't allow for settingSERIAL
orLOCAL_SERIAL
, despite them being supported by both Cassandra and Scylla for reads to use Paxos.Because the driver does not allow you to
session.Query("CONSISTENCY SERIAL").Exec()
(get's errorno viable alternative at input 'CONSISTENCY'
), it seems to be currently impossible to set SELECT consistency to SERIALThe text was updated successfully, but these errors were encountered: