CASSSIDECAR-277: Support testing of post-TCM Cassandra (#305) This commit adds support for post-TCM Cassandra in our integration testing. This is accomplished by: - Adding additional interception points to ByteBuddy where behavior has moved in Cassandra - Rewrote all tests that depended on unsafe range movements as TCM no longer allows them, and removed tests that could not be run in a safe manner (doubling/halving clusters all at once, for example) Additional changes unrelated to TCM: - Updated to latest in-jvm dtest API and removed some now-duplicate classes that moved to that library as part of CASSANDRA-20884. This was the original motivation for the PR, but led to the broader work to get things working on trunk again. - Updated maven-shade plugin so support multi-release dependencies - Fixed hang of Server shutdown, which was caused by double-closing the server. The second call to close caused all kinds of errors in logs and never completed. - Fix issue where snapshot builds don't have version numbers in gossip that quite match the version the dtest framework returns. - Several tests require streaming to start in 5.1, which requires the `network` feature to be enabled. - Some jmx methods that used to throw IllegalArgumentExceptions (dealing with intervals) now wrap those in IOExceptions. Attempt to unwrap those before throwing a generic RuntimeException, which breaks the handling of the exception downstream. - Handle newer Snapshot Already Exists messaging. JDK17 Support changes: - Add export for JMX test in server-common (jdk17) - exports/opens additions (jdk17) - Javadoc Fixes - Update CI workflows based on actually-supported jdks and some additonal jdk11 opens - Remove headers from some javadoc as different java versions expect different header levels CI Related changes - Remove jdk17 from 4.0/4.1 heavyweight - Add entries to /etc/hosts for localhost network aliases - Increase timeout for schema ready in SystemAuthDatabaseAccessorIntTest - Handle ConfigurationException where issue is bind failure. - Fix async issues in StreamCdcSegmentHandlerTest - Add cluster rebuild retry if CMS seeds can't be found Patch by Doug Rohrer, Yifan Cai; Reviewed by Francisco Guerrero, Jyothsna Konisa for CASSSIDECAR-277 Co-authored-by: Doug Rohrer <doug@therohrers.org>
This is a Sidecar for the highly scalable Apache Cassandra database. For more information, see the Apache Cassandra web site and CIP-1.
This is project is still WIP.
We depend on the Cassandra in-jvm dtest framework for testing. Because these jars are not published, you must manually build the dtest jars before you can build the project.
./scripts/build-dtest-jars.sh
The build script supports two parameters:
REPO - the Cassandra git repository to use for the source files. This is helpful if you need to test with a fork of the Cassandra codebase.git@github.com:apache/cassandra.gitBRANCHES - a space-delimited list of branches to build. -default: "cassandra-4.1 trunk"Remove any versions you may not want to test with. We recommend at least the latest (released) 4.X series and trunk. See Testing for more details on how to choose which Cassandra versions to use while testing.
For multi-node in-jvm dtests, network aliases will need to be setup for each Cassandra node. The tests assume each node's ip address is 127.0.0.x, where x is the node id.
For example if you populated your cluster with 3 nodes, create interfaces for 127.0.0.2 and 127.0.0.3 (the first node of course uses 127.0.0.1).
To get up and running, create a temporary alias for every node except the first:
for i in {2..20}; do sudo ifconfig lo0 alias "127.0.0.${i}"; done
Note that this does not persist across reboots, so you'll have to run it every time you restart.
After you clone the git repo, you can use the gradle wrapper to build and run the project. Make sure you have Apache Cassandra running on the host & port specified in conf/sidecar.yaml.
$ ./gradlew run
Alternatively, you can run against a local CCM cluster. Cassandra Sidecar provides a configuration for a 3-node CCM cluster named sidecardemo. You can use the gradle wrapper to run the project connected to a 3-node CCM cluster as follows:
$ ./gradlew run -Dsidecar.config=file:///$PWD/examples/conf/sidecar-ccm.yaml
Please see samples for details.
While setting up cassandra instance, make sure the data directories of cassandra are in the path stored in sidecar.yaml file, else modify data directories path to point to the correct directories for stream APIs to work.
The test framework is set up to run 4.1 and 5.1 (Trunk) tests (see TestVersionSupplier.java) by default. You can change this via the Java property cassandra.sidecar.versions_to_test by supplying a comma-delimited string. For example, -Dcassandra.sidecar.versions_to_test=4.0,4.1,5.1.
You will need to use the “Add Projects” function of CircleCI to set up CircleCI on your fork. When promoted to create a branch, do not replace the CircleCI config, choose the option to do it manually. CircleCI will pick up the in project configuration.
We warmly welcome and appreciate contributions from the community. Please see CONTRIBUTING.md if you wish to submit pull requests.
1 The Sidecar Client offers Java 1.8 compatibility, and produces artifacts for both Java 1.8 and Java 11.