From e9f8eab9be41ae89fac3bae176ad91f643c5b35c Mon Sep 17 00:00:00 2001 From: sylwiaszunejko Date: Thu, 9 May 2024 15:16:36 +0200 Subject: [PATCH] Use newFramerWithExts instead of newFramer to utilize protocol extensions 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 was set to `0` by default, causing the driver to consider every query executed as a LWT query. The issue was not immediately noticed because the only difference in behavior occurs when we want to use `ShuffleReplicas()` in `TokenAwareHostPolicy`. This commit fixes the issue by replacing `newFramer` with `newFramerWithExts`. --- conn.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conn.go b/conn.go index 32df37248..92630c5a6 100644 --- a/conn.go +++ b/conn.go @@ -769,7 +769,7 @@ func (c *Conn) recv(ctx context.Context) error { panic(fmt.Sprintf("call has incorrect streamID: got %d expected %d", call.streamID, head.stream)) } - framer := newFramer(c.compressor, c.version) + framer := newFramerWithExts(c.compressor, c.version, c.cqlProtoExts) err = framer.readFrame(c, &head) if err != nil {