cql-proxy icon indicating copy to clipboard operation
cql-proxy copied to clipboard

Handle mixed protocol versions e.g. client = V5, server = V4

Open mpenick opened this issue 4 years ago • 2 comments

The protocol version supported by the proxy shouldn't have to match the protocol version of the cluster. This could enable legacy applications. It could be fairly expensive to re-encode queries, so using the same protocol version should be preferred.

mpenick avatar Jun 29 '21 21:06 mpenick

Currently the proxy fails to connect with:

{"level":"error","ts":1636406235.5825562,"caller":"proxy/proxy.go:279","msg":"unable to decode frame","error":"cannot decode frame header: expected USE_BETA flag to be set for protocol version ProtocolVersion OSS 5 (beta)","stacktrace":"cql-proxy/proxy.(*client).Receive\n\t/go/src/cql-proxy/proxy/proxy.go:279\ncql-proxy/proxycore.(*Conn).read\n\t/go/src/cql-proxy/proxycore/conn.go:112"}

When using the default settings from the python driver.

Shouldn't it negotiate down to v4?

phact avatar Nov 08 '21 21:11 phact

The lib the proxy was using didn't support this, but has since been fixed: https://github.com/datastax/go-cassandra-native-protocol/pull/26

I'll upgrade and push a new release.

mpenick avatar Nov 08 '21 21:11 mpenick