Skip to content

Commit

Permalink
New maximum stream IDs test
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasz-antoniak committed Jul 17, 2024
1 parent c2e46f1 commit 4bd3785
Show file tree
Hide file tree
Showing 9 changed files with 508 additions and 197 deletions.
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,18 @@ It technically doesn't support v5, but handles protocol negotiation so that the
the protocol version to v4 if v5 is requested. This means that any client application using a recent driver that supports
protocol version v5 can be migrated using the ZDM Proxy (as long as it does not use v5-specific functionality).

ZDM Proxy requires origin and target clusters to have at least one protocol version in common. It is therefore not feasible
to configure Apache Cassandra 2.0 as origin and 3.x / 4.x as target. Below table displays protocol versions supported by
various C* versions:

| Apache Cassandra | Protocol Version |
|------------------|------------------|
| 2.0 | V2 |
| 2.1 | V2, V3 |
| 2.2 | V3, V4 |
| 3.x | V3, V4 |
| 4.x | V3, V4, V5 |

---
:warning: **Thrift is not supported by ZDM Proxy.** If you are using a very old driver or cluster version that only supports Thrift
then you need to change your client application to use CQL and potentially upgrade your cluster before starting the
Expand All @@ -110,7 +122,8 @@ migration process.

In practice this means that ZDM Proxy supports the following cluster versions (as Origin and / or Target):

- Apache Cassandra from 2.0+ up to (and including) Apache Cassandra 4.x.
- Apache Cassandra from 2.1+ up to (and including) Apache Cassandra 4.x.
- Apache Cassandra 2.0 up to 2.1.
- DataStax Enterprise 4.8+. DataStax Enterprise 4.6 and 4.7 support will be introduced when protocol version v2 is supported.
- DataStax Astra DB (both Serverless and Classic)

Expand Down
16 changes: 9 additions & 7 deletions integration-tests/connect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ func TestGoCqlConnect(t *testing.T) {
require.Equal(t, "fake", iter.Columns()[0].Name)
}

func TestProtocolVersionNegotiation(t *testing.T) {
// Simulacron-based test to make sure that we can handle invalid protocol error and downgrade
// used protocol on control connection. ORIGIN and TARGET are using the same C* version
func TestControlConnectionProtocolVersionNegotiation(t *testing.T) {
tests := []struct {
name string
clusterVersion string
Expand All @@ -63,13 +65,13 @@ func TestProtocolVersionNegotiation(t *testing.T) {
name: "Cluster3.0_MaxCCProtoVer4_NegotiatedProtoVer4",
clusterVersion: "3.0",
controlConnMaxProtocolVersion: "4",
negotiatedProtocolVersion: primitive.ProtocolVersion4,
negotiatedProtocolVersion: primitive.ProtocolVersion4, // make sure that protocol negotiation does not fail if it is not actually needed
},
{
name: "Cluster4.0_MaxCCProtoVer4_NegotiatedProtoVer4",
clusterVersion: "4.0",
controlConnMaxProtocolVersion: "4",
negotiatedProtocolVersion: primitive.ProtocolVersion4,
name: "Cluster3.0_MaxCCProtoVer3_NegotiatedProtoVer3",
clusterVersion: "3.0",
controlConnMaxProtocolVersion: "3",
negotiatedProtocolVersion: primitive.ProtocolVersion3, // protocol V3 applied as it is the maximum configured
},
}

Expand Down Expand Up @@ -103,7 +105,7 @@ func TestProtocolVersionNegotiation(t *testing.T) {
defer cqlClientConn.Close()

cqlConn, _ := testSetup.Proxy.GetOriginControlConn().GetConnAndContactPoint()
negotiatedProto := cqlConn.GetProtocolVersion().Load().(primitive.ProtocolVersion)
negotiatedProto := cqlConn.GetProtocolVersion()
require.Equal(t, tt.negotiatedProtocolVersion, negotiatedProto)

queryMsg := &message.Query{
Expand Down
171 changes: 0 additions & 171 deletions integration-tests/protocolv2_test.go

This file was deleted.

Loading

0 comments on commit 4bd3785

Please sign in to comment.