From 2fc2be54caf4f1861cac8e93146ace03de5e1db6 Mon Sep 17 00:00:00 2001 From: Jacek Lewandowski Date: Wed, 13 Dec 2023 10:44:29 +0100 Subject: [PATCH] Fix the correspondingMessagingVersion of SSTable format and improve TTL overflow tests coverage Patch by Jacek Lewandowski; reviewed by Berenguer Blasi for CASSANDRA-19197 --- CHANGES.txt | 2 + build.xml | 7 + conf/cassandra.yaml | 32 +-- ide/idea/workspace.xml | 3 +- .../io/sstable/format/big/BigFormat.java | 4 +- .../io/sstable/format/bti/BtiFormat.java | 2 +- .../MixedModeTTLOverflowAfterUpgradeTest.java | 60 +++++ ...MixedModeTTLOverflowDuringUpgradeTest.java | 61 +++++ .../MixedModeTTLOverflowUpgradeTest.java | 161 ------------- .../MixedModeTTLOverflowUpgradeTestBase.java | 219 ++++++++++++++++++ .../cql3/validation/operations/TTLTest.java | 106 +++++---- 11 files changed, 432 insertions(+), 225 deletions(-) create mode 100644 test/distributed/org/apache/cassandra/distributed/upgrade/MixedModeTTLOverflowAfterUpgradeTest.java create mode 100644 test/distributed/org/apache/cassandra/distributed/upgrade/MixedModeTTLOverflowDuringUpgradeTest.java delete mode 100644 test/distributed/org/apache/cassandra/distributed/upgrade/MixedModeTTLOverflowUpgradeTest.java create mode 100644 test/distributed/org/apache/cassandra/distributed/upgrade/MixedModeTTLOverflowUpgradeTestBase.java diff --git a/CHANGES.txt b/CHANGES.txt index 5c43c68bf373..3ea5a79229c8 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,5 @@ 5.0-beta2 + * Fix the correspondingMessagingVersion of SSTable format and improve TTL overflow tests coverage (CASSANDRA-19197) * Fix resource cleanup after SAI query timeouts (CASSANDRA-19177) * Suppress CVE-2023-6481 (CASSANDRA-19184) Merged from 4.1: @@ -7,6 +8,7 @@ Merged from 4.0: Merged from 3.11: Merged from 3.0: + 5.0-beta1 * Fix SAI intersection queries (CASSANDRA-19011) * Clone EndpointState before sending GossipShutdown message (CASSANDRA-19115) diff --git a/build.xml b/build.xml index e3f5a517a55f..a701786f84e7 100644 --- a/build.xml +++ b/build.xml @@ -1237,12 +1237,16 @@ + + + + @@ -1764,6 +1768,7 @@ + @@ -1800,6 +1805,7 @@ + @@ -1815,6 +1821,7 @@ + diff --git a/conf/cassandra.yaml b/conf/cassandra.yaml index ba0eb864a686..3f9dfc577e1f 100644 --- a/conf/cassandra.yaml +++ b/conf/cassandra.yaml @@ -2113,27 +2113,27 @@ drop_compact_storage_enabled: false # This property indicates with what Cassandra major version the storage format will be compatible with. # -# The chosen storage compatiblity mode will determine the versions of the written sstables, commitlogs, hints, -# etc. Those storage elements will use the higher minor versions of the major version that corresponds to the -# Cassandra version we want to stay compatible with. For example, if we want to stay compatible with Cassandra 4.0 -# or 4.1, the value of this property should be 4, and that will make us use 'oa' sstables. +# The chosen storage compatibility mode will determine the versions of the written sstables, commitlogs, hints, etc. +# For example, if we're going to remain compatible with Cassandra 4.x, the value of this property should be 4, which +# will make us use sstables in the latest N version of the BIG format. # -# This will also determine if certain features depending on newer formats are available. For example, extended TTLs -# up to 2106 depend on the sstable, commitlog, hints and messaging versions that were introduced by Cassandra 5.0, -# so that feature won't be available if this property is set to CASSANDRA_4. See upgrade guides for details. Currently -# the only supported major is CASSANDRA_4. +# This will also determine if certain features that depend on newer formats are available. For example, extended TTL +# (up to 2106) depends on the sstable, commit-log, hints, and messaging versions introduced by Cassandra 5.0, so that +# feature won't be available if this property is set to CASSANDRA_4. See the upgrade guide for more details. # -# Possible values are in the StorageCompatibilityMode.java file accessible online. At the time of writing these are: +# Possible values are: # - CASSANDRA_4: Stays compatible with the 4.x line in features, formats and component versions. -# - UPGRADING: The cluster monitors nodes versions during this interim stage. _This has a cost_ but ensures any new features, -# formats, versions, etc are enabled safely. +# - UPGRADING: The cluster monitors the version of each node during this interim stage. This has a cost but ensures +# all new features, formats, versions, etc. are enabled safely. # - NONE: Start with all the new features and formats enabled. # # A typical upgrade would be: -# - Do a rolling upgrade starting all nodes in CASSANDRA_Y compatibility mode. -# - Once the new binary is rendered stable do a rolling restart with UPGRADING. The cluster will enable new features in a safe way -# until all nodes are started in UPGRADING, then all new features are enabled. -# - Do a rolling restart with all nodes starting with NONE. This sheds the extra cost of checking nodes versions and ensures -# a stable cluster. If a node from a previous version was started by accident we won't any longer toggle behaviors as when UPGRADING. +# - Do a rolling upgrade, starting all nodes in CASSANDRA_X compatibility mode. +# - Once the new binary is rendered stable, do a rolling restart with the UPGRADING mode. The cluster will keep new +# features disabled until all nodes are started in the UPGRADING mode; when that happens, new features controlled by +# the storage compatibility mode are enabled. +# - Do a rolling restart with all nodes starting with the NONE mode. This eliminates the cost of checking node versions +# and ensures stability. If Cassandra was started at the previous version by accident, a node with disabled +# compatibility mode would no longer toggle behaviors as when it was running in the UPGRADING mode. # storage_compatibility_mode: CASSANDRA_4 diff --git a/ide/idea/workspace.xml b/ide/idea/workspace.xml index ffd7530ad3eb..89528b240854 100644 --- a/ide/idea/workspace.xml +++ b/ide/idea/workspace.xml @@ -200,8 +200,9 @@ -Dmigration-sstable-root=$PROJECT_DIR$/test/data/migration-sstables -XX:ActiveProcessorCount=2 -XX:HeapDumpPath=build/test - -XX:MaxMetaspaceSize=1G + -XX:MaxMetaspaceSize=2G -XX:SoftRefLRUPolicyMSPerMB=0 + -Xmx4G -ea" />