scylladb / gocql

Package gocql implements a fast and robust ScyllaDB client for the Go programming language.

Home Page:https://docs.scylladb.com/stable/using-scylla/drivers/cql-drivers/scylla-go-driver.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Queries are marked as LWT incorrectly

sylwiaszunejko opened this issue · comments

When LWT optimization was implemented in gocql (#49), all newFramer calls were replaced with newFramerWithExts calls.

Previously, during the upstream merging the code using newFramer was added (#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.