Skip to content

Add Cassandra 5.0 storage backend support and integration tests#4897

Open
Ranexia04 wants to merge 1 commit into
JanusGraph:masterfrom
Ranexia04:add-cassandra5-integration-tests
Open

Add Cassandra 5.0 storage backend support and integration tests#4897
Ranexia04 wants to merge 1 commit into
JanusGraph:masterfrom
Ranexia04:add-cassandra5-integration-tests

Conversation

@Ranexia04

Copy link
Copy Markdown

Addresses #4842.

Summary

Adds Cassandra 5.0 support to the CQL backend: a real bug fix surfaced by running the existing test suite against Cassandra 5.0, plus integration-test coverage so 5.0 is exercised the same way 3.11 / 4.0 are.

Bug fix

When compression is disabled (storage.cql.compression = false), CQLKeyColumnValueStore used the driver's withNoCompression(), which emits the legacy compression = {'sstable_compression': ''} form. Cassandra 5.0 rejects this with InvalidConfigurationInQueryException: Missing sub-option 'class' for the 'compression' option. On Cassandra 5+ we now disable compression via {'enabled': false}, which is accepted by all supported Cassandra versions (3.x/4.x behavior is unchanged). This mirrors the existing version-aware handling already present for the enabled-compression options.

Test coverage

  • cassandra5-byteordered, cassandra5-murmur, cassandra5-murmur-ssl, cassandra5-murmur-client-auth Maven profiles (mirroring the cassandra4-* ones), pinned to 5.0.8.
  • cassandra5-*.yaml test configs written in the modern Cassandra 5.0 parameter format (unit-suffixed names, e.g. read_request_timeout: 5000ms) so the server boots with no deprecation warnings.
  • JanusGraphCassandraContainer.getConfigPrefix() now resolves cassandra5 for 5.x.
  • CI matrix entries in ci-backend-cql.yml (diskstorage / graphdb / core / hadoop / ssl / client-auth, Java 11 test client).
  • Docs note that 3.11 / 4.0 / 5.0 are integration-tested.

Verification

All cassandra5-* CQL jobs pass on CI. The compression fix was also reproduced and confirmed against a live cassandra:5.0 container: the legacy form reproduces the exact error, while {'enabled': false} succeeds and reads back as {'enabled': 'false'} (which testDisableCFCompressor accepts).

Note on CI cost: this adds ~10 jobs to the always-on tests matrix. Happy to narrow the matrix (e.g. drop the byteordered or ssl/client-auth variants for 5.0) if that's preferred.


For all changes:

For code changes:

  • Have you written and/or updated unit tests to verify your changes?
  • If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0? (no new dependencies)
  • If applicable, have you updated the LICENSE.txt file? (not applicable)
  • If applicable, have you updated the NOTICE.txt file? (not applicable)

For documentation related changes:

  • Have you ensured that format looks appropriate for the output in which it is rendered?

@linux-foundation-easycla

linux-foundation-easycla Bot commented Jun 8, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: Ranexia04 / name: Henrique Lourenço (ab084e0)

Addresses JanusGraph#4842.

Fix the disable-compression code path in CQLKeyColumnValueStore, which
emitted the legacy {'sstable_compression': ''} option that Cassandra 5.0
rejects ("Missing sub-option 'class'"); disable via {'enabled': false}
on Cassandra 5+ instead.

Add Cassandra 5.0 integration-test coverage: cassandra5-* Maven profiles,
modern-format cassandra5 test YAML configs, JanusGraphCassandraContainer
5.x config-prefix support, CI matrix entries, and docs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Henrique Lourenço <henrique@mapped.com>
@Ranexia04 Ranexia04 force-pushed the add-cassandra5-integration-tests branch from ab084e0 to 2148d36 Compare June 8, 2026 09:55
final int cassandraMajorVersion) {
if (!configuration.get(CF_COMPRESSION)) {
// No compression
// Cassandra 5+ rejects {'sstable_compression': ''} — use {'enabled': false} instead.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CassandraContainer.withNoCompression() generates compression = {'sstable_compression': ''}, which Cassandra 5.0 rejects with "Missing sub-option 'class' for the 'compression' option". The {'enabled': false} form is accepted by Cassandra 3.x, 4.x, and 5.x, so this branch is only needed for the sstable_compression → enabled rename rather than an incompatibility in the disable-compression semantics themselves.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Apache Cassandra 5.0 support for JanusGraph’s CQL storage backend, including a table-creation compatibility fix around compression options and CI/integration-test coverage so Cassandra 5.0 is exercised similarly to 3.11 and 4.0.

Changes:

  • Add Cassandra 5.0-specific cassandra.yaml templates for the existing testcontainer-based integration tests (murmur/byteordered, plus SSL and client-auth variants).
  • Update CQL table creation to use Cassandra-5-compatible compression options when compression is disabled.
  • Add Maven profiles and CI matrix entries to run the existing CQL integration test suites against Cassandra 5.0, and update documentation to reflect the supported/tested versions.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
janusgraph-cql/src/main/java/org/janusgraph/diskstorage/cql/CQLKeyColumnValueStore.java Adjusts table creation compression options for Cassandra 5 when compression is disabled.
janusgraph-cql/src/test/java/org/janusgraph/JanusGraphCassandraContainer.java Selects cassandra5-* test config prefix for 5.x containers.
janusgraph-cql/pom.xml Adds Cassandra 5.0 docker version property and Maven profiles mirroring the existing cassandra4 profiles.
janusgraph-cql/src/test/resources/cassandra5-murmur.yaml New Cassandra 5.0 murmur-partitioner config using modern unit-suffixed settings.
janusgraph-cql/src/test/resources/cassandra5-byteordered.yaml New Cassandra 5.0 byteordered-partitioner config using modern unit-suffixed settings.
janusgraph-cql/src/test/resources/cassandra5-murmur-ssl.yaml New Cassandra 5.0 SSL-enabled config.
janusgraph-cql/src/test/resources/cassandra5-murmur-client-auth.yaml New Cassandra 5.0 SSL + client-auth config.
docs/storage-backend/cassandra.md Documents that 3.11/4.0/5.0 are integration-tested and notes version-adaptive compression handling.
.github/workflows/ci-backend-cql.yml Adds Cassandra 5.0 jobs to the always-on CI matrix for CQL module test suites.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 339 to 344
if (!configuration.get(CF_COMPRESSION)) {
// No compression
// Cassandra 5+ rejects {'sstable_compression': ''} — use {'enabled': false} instead.
if (cassandraMajorVersion >= 5)
return createTable.withOption("compression", ImmutableMap.of("enabled", false));
return createTable.withNoCompression();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants