Skip to content

Commit a2f0c61

Browse files
authored
Support protocol v5, blocked protocol versions and CI improvements (#157)
- Add protocol v5 support - Add integration test matrix with multiple cassandra versions - Upgrade nosqlbench to version 5 so it uses a modern java driver with v5 support (have to keep nb4 for verify step) - Cache Go, Simulacron and CCM C* downloads - Upgrade gocql to 2.0.0 - Upgrade go-cassandra-native-protocol to latest - Add blocked_protocol_versions
1 parent ef6fbee commit a2f0c61

69 files changed

Lines changed: 4199 additions & 1101 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/tests.yml

Lines changed: 125 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,42 @@ on:
99
concurrency:
1010
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
1111
cancel-in-progress: true
12+
env:
13+
SIMULACRON_VERSION: 0.10.0
14+
GO_VERSION: 1.24.2
1215
jobs:
16+
dependencies:
17+
name: Fetch dependencies
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/cache@v4
21+
id: restore-go
22+
with:
23+
path: ~/deps/godl
24+
key: ${{ runner.os }}-deps-godl-${{ env.GO_VERSION }}
25+
26+
- uses: actions/cache@v4
27+
id: restore-simulacron
28+
with:
29+
path: ~/deps/simulacron
30+
key: ${{ runner.os }}-deps-simulacron-${{ env.SIMULACRON_VERSION }}
31+
32+
- if: ${{ steps.restore-go.outputs.cache-hit != 'true' }}
33+
name: Download Go
34+
continue-on-error: true
35+
run: |
36+
mkdir -p ~/deps/godl
37+
cd ~/deps/godl
38+
wget -O go.tar.gz https://go.dev/dl/go${{ env.GO_VERSION }}.linux-amd64.tar.gz
39+
40+
- if: ${{ steps.restore-simulacron.outputs.cache-hit != 'true' }}
41+
name: Download simulacron
42+
continue-on-error: true
43+
run: |
44+
mkdir -p ~/deps/simulacron
45+
cd ~/deps/simulacron
46+
wget -O simulacron.jar https://github.com/datastax/simulacron/releases/download/${{ env.SIMULACRON_VERSION }}/simulacron-standalone-${{ env.SIMULACRON_VERSION }}.jar
47+
1348
# Runs a NoSQLBench job in docker-compose with 3 proxy nodes
1449
# Verifies the written data matches in both ORIGIN and TARGET clusters
1550
nosqlbench-tests:
@@ -20,7 +55,7 @@ jobs:
2055
- name: Start docker-compose
2156
id: compose
2257
run: |
23-
docker compose -f docker-compose-tests.yml up --abort-on-container-exit --exit-code-from=nosqlbench
58+
docker compose -f docker-compose-tests.yml up --abort-on-container-exit --exit-code-from=nosqlbench4
2459
- name: Test Summary
2560
if: ${{ failure() }}
2661
run: |
@@ -29,15 +64,20 @@ jobs:
2964
# Runs all the unit tests under the proxy module (all the *_test.go files)
3065
unit-tests:
3166
name: Unit Tests
67+
needs: dependencies
3268
runs-on: ubuntu-latest
3369
steps:
3470
- uses: actions/checkout@v2
71+
- uses: actions/cache@v4
72+
id: restore-go
73+
with:
74+
path: ~/deps/godl
75+
key: ${{ runner.os }}-deps-godl-${{ env.GO_VERSION }}
3576
- name: Run
3677
run: |
3778
sudo apt update
3879
sudo apt -y install default-jre gcc git wget
39-
wget https://go.dev/dl/go1.24.2.linux-amd64.tar.gz
40-
sudo tar -xzf go*.tar.gz -C /usr/local/
80+
sudo tar -xzf ~/deps/godl/go.tar.gz -C /usr/local/
4181
export PATH=$PATH:/usr/local/go/bin
4282
export PATH=$PATH:`go env GOPATH`/bin
4383
go install github.com/jstemmer/go-junit-report/v2@latest
@@ -52,21 +92,35 @@ jobs:
5292
# These tests use Simulacron and in-memory CQLServer
5393
integration-tests-mock:
5494
name: Mock Tests
95+
needs: dependencies
5596
runs-on: ubuntu-latest
5697
steps:
5798
- uses: actions/checkout@v2
99+
100+
- uses: actions/cache@v4
101+
id: restore-go
102+
with:
103+
path: ~/deps/godl
104+
key: ${{ runner.os }}-deps-godl-${{ env.GO_VERSION }}
105+
106+
- uses: actions/cache@v4
107+
id: restore-simulacron
108+
with:
109+
path: ~/deps/simulacron
110+
key: ${{ runner.os }}-deps-simulacron-${{ env.SIMULACRON_VERSION }}
111+
58112
- name: Run
59113
run: |
60114
sudo apt update
61115
sudo apt -y install openjdk-8-jdk gcc git wget
62-
wget https://go.dev/dl/go1.24.2.linux-amd64.tar.gz
63-
sudo tar -xzf go*.tar.gz -C /usr/local/
116+
sudo tar -xzf ~/deps/godl/go.tar.gz -C /usr/local/
64117
export PATH=$PATH:/usr/local/go/bin
65118
export PATH=$PATH:`go env GOPATH`/bin
66119
go install github.com/jstemmer/go-junit-report/v2@latest
67-
wget https://github.com/datastax/simulacron/releases/download/0.10.0/simulacron-standalone-0.10.0.jar
68-
export SIMULACRON_PATH=`pwd`/simulacron-standalone-0.10.0.jar
120+
cp ~/deps/simulacron/simulacron.jar .
121+
export SIMULACRON_PATH=`pwd`/simulacron.jar
69122
go test -timeout 180m -v 2>&1 ./integration-tests | go-junit-report -set-exit-code -iocopy -out report-integration-mock.xml
123+
70124
- name: Test Summary
71125
uses: test-summary/action@v1
72126
if: always()
@@ -76,26 +130,63 @@ jobs:
76130
# Runs integration tests using CCM
77131
integration-tests-ccm:
78132
name: CCM Tests
133+
needs: dependencies
79134
runs-on: ubuntu-latest
135+
strategy:
136+
fail-fast: false
137+
matrix:
138+
cassandra_version: [ '2.2.19', '3.11.19', '4.1.9', '5.0.6', 'dse-4.8.16', 'dse-5.1.48', 'dse-6.8.61' ]
80139
steps:
81140
- uses: actions/checkout@v2
141+
142+
- uses: actions/cache@v4
143+
id: restore-go
144+
with:
145+
path: ~/deps/godl
146+
key: ${{ runner.os }}-deps-godl-${{ env.GO_VERSION }}
147+
148+
- uses: actions/cache@v4
149+
id: restore-cache-ccm
150+
with:
151+
path: ~/.ccm/repository
152+
key: ${{ runner.os }}-ccm-${{ matrix.cassandra_version }}
153+
82154
- name: Run
83155
run: |
84156
sudo apt update
157+
85158
sudo apt -y install openjdk-8-jdk gcc git wget pip
86-
wget https://go.dev/dl/go1.24.2.linux-amd64.tar.gz
87-
sudo tar -xzf go*.tar.gz -C /usr/local/
88-
export PATH=$PATH:/usr/local/go/bin
89-
export PATH=$PATH:`go env GOPATH`/bin
159+
sudo apt -y install openjdk-11-jdk gcc git wget pip
160+
90161
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
162+
export JAVA8_HOME=/usr/lib/jvm/java-8-openjdk-amd64
163+
export JAVA11_HOME=/usr/lib/jvm/java-11-openjdk-amd64
91164
export PATH=$JAVA_HOME/bin:$PATH
92165
java -version
166+
167+
sudo tar -xzf ~/deps/godl/go.tar.gz -C /usr/local/
168+
export PATH=$PATH:/usr/local/go/bin
169+
export PATH=$PATH:`go env GOPATH`/bin
170+
93171
go install github.com/jstemmer/go-junit-report/v2@latest
94-
pip install ccm
172+
173+
CCM_VERSION="0e20102c1cad99104969239f1ac375b6fcaa7bbc"
174+
export CCM_VERSION
175+
echo "Install CCM ${CCM_VERSION}"
176+
pip install "git+https://github.com/apache/cassandra-ccm.git@${CCM_VERSION}"
177+
95178
which ccm
96179
sudo ln -s /home/runner/.local/bin/ccm /usr/local/bin/ccm
97180
/usr/local/bin/ccm list
98-
go test -timeout 180m -v 2>&1 ./integration-tests -RUN_MOCKTESTS=false -RUN_CCMTESTS=true | go-junit-report -set-exit-code -iocopy -out report-integration-ccm.xml
181+
182+
go test -timeout 180m -v 2>&1 ./integration-tests -RUN_MOCKTESTS=false -RUN_CCMTESTS=true -CASSANDRA_VERSION=${{ matrix.cassandra_version }} | go-junit-report -set-exit-code -iocopy -out report-integration-ccm.xml
183+
184+
- uses: actions/cache/save@v4
185+
if: always()
186+
with:
187+
path: ~/.ccm/repository
188+
key: ${{ runner.os }}-ccm-${{ matrix.cassandra_version }}
189+
99190
- name: Test Summary
100191
uses: test-summary/action@v1
101192
if: always()
@@ -105,21 +196,31 @@ jobs:
105196
# Runs the mock tests with go's race checker to spot potential data races
106197
race-checker:
107198
name: Race Checker
199+
needs: dependencies
108200
runs-on: ubuntu-latest
109201
if: ${{ false }} # temporarily disabled
110202
steps:
111203
- uses: actions/checkout@v2
204+
- uses: actions/cache@v4
205+
id: restore-simulacron
206+
with:
207+
path: ~/deps/simulacron
208+
key: ${{ runner.os }}-deps-simulacron-${{ env.SIMULACRON_VERSION }}
209+
- uses: actions/cache@v4
210+
id: restore-go
211+
with:
212+
path: ~/deps/godl
213+
key: ${{ runner.os }}-deps-godl-${{ env.GO_VERSION }}
112214
- name: Run
113215
run: |
114216
sudo apt update
115217
sudo apt -y install openjdk-8-jdk gcc git pip wget
116-
wget https://go.dev/dl/go1.24.2.linux-amd64.tar.gz
117-
sudo tar -xzf go*.tar.gz -C /usr/local/
218+
sudo tar -xzf ~/deps/godl/go.tar.gz -C /usr/local/
118219
export PATH=$PATH:/usr/local/go/bin
119220
export PATH=$PATH:`go env GOPATH`/bin
120221
go install github.com/jstemmer/go-junit-report/v2@latest
121-
wget https://github.com/datastax/simulacron/releases/download/0.10.0/simulacron-standalone-0.10.0.jar
122-
export SIMULACRON_PATH=`pwd`/simulacron-standalone-0.10.0.jar
222+
cp ~/deps/simulacron/simulacron.jar .
223+
export SIMULACRON_PATH=`pwd`/simulacron.jar
123224
go test -race -timeout 180m -v 2>&1 ./integration-tests | go-junit-report -set-exit-code -iocopy -out report-integration-race.xml
124225
- name: Test Summary
125226
uses: test-summary/action@v1
@@ -130,16 +231,21 @@ jobs:
130231
# Performs static analysis to check for things like context leaks
131232
go-vet:
132233
name: Go Vet
234+
needs: dependencies
133235
runs-on: ubuntu-latest
134236
if: ${{ false }} # temporarily disabled
135237
steps:
136238
- uses: actions/checkout@v2
239+
- uses: actions/cache@v4
240+
id: restore-go
241+
with:
242+
path: ~/deps/godl
243+
key: ${{ runner.os }}-deps-godl-${{ env.GO_VERSION }}
137244
- name: Run
138245
run: |
139246
sudo apt update
140247
sudo apt -y install openjdk-8-jdk gcc git pip wget
141-
wget https://go.dev/dl/go1.24.2.linux-amd64.tar.gz
142-
sudo tar -xzf go*.tar.gz -C /usr/local/
248+
sudo tar -xzf ~/deps/godl/go.tar.gz -C /usr/local/
143249
export PATH=$PATH:/usr/local/go/bin
144250
export PATH=$PATH:`go env GOPATH`/bin
145251
go vet ./...

CHANGELOG/CHANGELOG-2.3.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@ Changelog for the ZDM Proxy, new PRs should update the `unreleased` section.
44

55
When cutting a new release, update the `unreleased` heading to the tag being generated and date, like `## vX.Y.Z - YYYY-MM-DD` and create a new placeholder section for `unreleased` entries.
66

7-
## Unreleased
8-
9-
* [#150](https://github.com/datastax/zdm-proxy/issues/150): CQL request tracing
10-
* [#154](https://github.com/datastax/zdm-proxy/issues/154): Support CQL request compression
11-
127
---
138

149
## v2.3.4 - 2025-05-29

CHANGELOG/CHANGELOG-2.4.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Changelog
2+
3+
Changelog for the ZDM Proxy, new PRs should update the `unreleased` section.
4+
5+
When cutting a new release, update the `unreleased` heading to the tag being generated and date, like `## vX.Y.Z - YYYY-MM-DD` and create a new placeholder section for `unreleased` entries.
6+
7+
---
8+
9+
## v2.4.0 - 2026-01-16
10+
11+
### New Features
12+
13+
* [#150](https://github.com/datastax/zdm-proxy/issues/150): CQL request tracing
14+
* [#154](https://github.com/datastax/zdm-proxy/issues/154): Support CQL request compression
15+
* [#157](https://github.com/datastax/zdm-proxy/pull/157): Support protocol v5
16+
* [#157](https://github.com/datastax/zdm-proxy/pull/157): New Configuration setting to block specific protocol versions
17+
18+
### Improvements
19+
20+
* [#157](https://github.com/datastax/zdm-proxy/pull/157): Improvements to CI so we can find regressions with multiple C* versions before merging a PR

RELEASE_NOTES.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,18 @@ Build artifacts are available at [Docker Hub](https://hub.docker.com/repository/
66

77
For additional details on the changes included in a specific release, see the associated CHANGELOG-x.x.md file.
88

9+
## v2.4.0 - 2026-01-16
10+
11+
Support LZ4 and snappy compression.
12+
13+
Support protocol v5.
14+
15+
New configuration setting `ZDM_BLOCKED_PROTOCOL_VERSIONS` to block specific protocol versions at the proxy level.
16+
17+
Send request id in the request payload (currently supported by Astra only).
18+
19+
[Changelog](CHANGELOG/CHANGELOG-2.4.md#v240---2026-01-16)
20+
921
## v2.3.4 - 2025-05-29
1022

1123
Fix CQL stream ID validation for internal heartbeat mechanism.

compose/nosqlbench-entrypoint.sh

Lines changed: 0 additions & 78 deletions
This file was deleted.

0 commit comments

Comments
 (0)