apache / cassandra-gocql-driver

GoCQL Driver for Apache Cassandra®
https://cassandra.apache.org/
Apache License 2.0
2.58k stars 621 forks source link

Add Consistency for ObservedQuery #1798

Open Rikkuru opened 2 months ago

Rikkuru commented 2 months ago

What version of Cassandra are you using?

scylladb 5.1.19

What version of Gocql are you using?

fork scylladb/gocql v1.12.0 ( includes v1.6.0 gocql/gocql)

What version of Go are you using?

1.21

What did you do?

tried to write observer for several possible retry pilicies some of which change query Consistency

What did you expect to see?

I expected to find a way to get current query Consistency from ObservedQuery

What did you see instead?

there is no field Consistency in ObservedQuery

I think it can be useful to have field with current Consistency in ObservedQuery RetryPolicy can change Consistency and I wanted to detect downgrades of CL in Observer but for now I had to check used RetryPolicy and Attempt to get this query CL It is not difficult to do with DowngradingConsistencyRetryPolicy , but I use different policies in project and it can be bothersome

danthegoodman1 commented 1 week ago

Absolutely agree.

With ScyllaDB we can have serial selects, but I can't tell if its working. The docs say:

// SerialConsistency sets the consistency level for the
// serial phase of conditional updates. That consistency can only be
// either SERIAL or LOCAL_SERIAL and if not present, it defaults to
// SERIAL. This option will be ignored for anything else that a
// conditional update/insert.

which makes me wonder if this is ignored at the package level (we're screwed), or at the Cassandra level (ok bc scylla knows what to do with it)