scylladb / gocql

Package gocql implements a fast and robust ScyllaDB client for the Go programming language.
https://docs.scylladb.com/stable/using-scylla/drivers/cql-drivers/scylla-go-driver.html
BSD 3-Clause "New" or "Revised" License
181 stars 57 forks source link

Queries are marked as LWT incorrectly #174

Closed sylwiaszunejko closed 4 months ago

sylwiaszunejko commented 4 months ago

When LWT optimization was implemented in gocql (https://github.com/scylladb/gocql/pull/49), all newFramer calls were replaced with newFramerWithExts calls.

Previously, during the upstream merging the code using newFramer was added (https://github.com/scylladb/gocql/pull/109) and it was forgotten to replace it with newFramerWithExts. That way, the flagLWT field is set to 0 by default, causing the driver to consider every query executed as a LWT query. For example simple INSERT or SELECT queries are marked as LWT (SELECT pk, ck, v FROM keyspace1.table1 WHERE pk = x;)

This can potentially impact the performance if we want to use ShuffleReplicas() in TokenAwareHostPolicy. If query is marked as LWT the replica shuffling would be disabled.