Add Cassandra 5.0 storage backend support and integration tests#4897
Add Cassandra 5.0 storage backend support and integration tests#4897Ranexia04 wants to merge 1 commit into
Conversation
|
|
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>
ab084e0 to
2148d36
Compare
| final int cassandraMajorVersion) { | ||
| if (!configuration.get(CF_COMPRESSION)) { | ||
| // No compression | ||
| // Cassandra 5+ rejects {'sstable_compression': ''} — use {'enabled': false} instead. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
compressionoptions 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.
| 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(); | ||
| } |
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),CQLKeyColumnValueStoreused the driver'swithNoCompression(), which emits the legacycompression = {'sstable_compression': ''}form. Cassandra 5.0 rejects this withInvalidConfigurationInQueryException: 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-authMaven profiles (mirroring thecassandra4-*ones), pinned to5.0.8.cassandra5-*.yamltest 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 resolvescassandra5for 5.x.ci-backend-cql.yml(diskstorage / graphdb / core / hadoop / ssl / client-auth, Java 11 test client).Verification
All
cassandra5-*CQL jobs pass on CI. The compression fix was also reproduced and confirmed against a livecassandra:5.0container: the legacy form reproduces the exact error, while{'enabled': false}succeeds and reads back as{'enabled': 'false'}(whichtestDisableCFCompressoraccepts).For all changes:
master)?For code changes:
For documentation related changes: