Skip to content

Commit 73f8fb9

Browse files
authored
Fix Agent for CC5 (#706)
* Update CC5 version This patch updates the CC5 version to a more recent 5.0.4 and updates the Message.Request.execute() call so it matches the updated method signature in CC5. Also adds Docker login step to pull private base images for DSE
1 parent da5bba8 commit 73f8fb9

File tree

5 files changed

+18
-3
lines changed

5 files changed

+18
-3
lines changed

.github/workflows/ci.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,11 @@ jobs:
246246
image: tonistiigi/binfmt:qemu-v7.0.0-28
247247
- name: Set up Docker Buildx
248248
uses: docker/setup-buildx-action@v3
249+
- name: Login to DockerHub
250+
uses: docker/login-action@v3
251+
with:
252+
username: ${{ secrets.DOCKER_HUB_USERNAME }}
253+
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
249254
- name: Build DSE ${{ matrix.dse-version }}-${{ matrix.base-platform }}
250255
id: docker_build
251256
uses: docker/build-push-action@v5

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Changelog for Management API, new PRs should update the `main / unreleased` sect
1010
```
1111

1212
## unreleased
13+
* [BUGFIX] [#705](https://github.com/k8ssandra/management-api-for-apache-cassandra/issues/705) Fix Agent for CC5
1314

1415
## v0.1.110 [2025-11-20]
1516
* [FEATURE] [#695](https://github.com/k8ssandra/management-api-for-apache-cassandra/issues/695) Add Cassandra 5.0.6 to the build matrix

management-api-agent-hcd-cc5/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
<dependency>
8080
<groupId>com.datastax.dse</groupId>
8181
<artifactId>dse-db-all</artifactId>
82-
<version>5.0.0-beta2.b8452cef5a56</version>
82+
<version>5.0.4.0-c64ed2865363</version>
8383
<exclusions>
8484
<exclusion>
8585
<groupId>commons-codec</groupId>

management-api-agent-hcd-cc5/src/main/java/com/datastax/mgmtapi/shim/RpcStatement.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import org.apache.cassandra.cql3.QueryOptions;
1111
import org.apache.cassandra.service.ClientState;
1212
import org.apache.cassandra.service.QueryState;
13+
import org.apache.cassandra.transport.Dispatcher.RequestTime;
1314
import org.apache.cassandra.transport.messages.ResultMessage;
1415

1516
public class RpcStatement implements RpcStatementShim {
@@ -33,6 +34,15 @@ public ResultMessage execute(QueryState queryState, QueryOptions queryOptions, l
3334
return new ResultMessage.Void();
3435
}
3536

37+
/**
38+
* as of Cassandra 4.1.6, CASSANDRA-19534, org.apache.cassandra.cql3.CQLStatement now has the
39+
* method signature below, but it does not exist in Cassandra < 4.1.6. For Cassandra 5.0, this fix
40+
* was ported between 5.0-rc1 and 5.0-rc2.
41+
*/
42+
public ResultMessage execute(QueryState queryState, QueryOptions queryOptions, RequestTime rt) {
43+
return new ResultMessage.Void();
44+
}
45+
3646
@Override
3747
public ResultMessage executeLocally(QueryState queryState, QueryOptions queryOptions) {
3848
return new ResultMessage.Void();

management-api-agent-hcd-cc5/src/main/java/org/apache/cassandra/transport/UnixSocketServerHcd.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ protected void channelRead0(ChannelHandlerContext ctx, Message.Request request)
8181
throws Exception {
8282

8383
final UnixSocketConnection connection;
84-
long queryStartNanoTime = System.nanoTime();
8584

8685
try {
8786
assert request.connection() instanceof UnixSocketConnection;
@@ -101,7 +100,7 @@ protected void channelRead0(ChannelHandlerContext ctx, Message.Request request)
101100
// make the correct calls based on which version of 4.1.x we are. For Cassandra 5.0, this
102101
// patch was ported between 5.0-rc1 and 5.0-rc2.
103102
request
104-
.execute(qstate, queryStartNanoTime)
103+
.execute(qstate, Dispatcher.RequestTime.forImmediateExecution())
105104
.addCallback(
106105
(Message.Response response, Throwable ignore) -> {
107106
processMessageResponse(response, request, connection, ctx);

0 commit comments

Comments
 (0)