From 891e65e251d102d2664f84d22734b95235a7cb16 Mon Sep 17 00:00:00 2001 From: Jackson Fleming Date: Mon, 15 Jul 2024 14:47:02 +0200 Subject: [PATCH 1/6] Fix rendering issues in cassandra.yaml for gen-asciidoc target patch by Jackson Fleming; reviewed by Stefan Miklosovic and Brandon Williams for CASSANDRA-19767 --- doc/scripts/convert_yaml_to_adoc.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/scripts/convert_yaml_to_adoc.py b/doc/scripts/convert_yaml_to_adoc.py index 5eff522a00..3b03856986 100644 --- a/doc/scripts/convert_yaml_to_adoc.py +++ b/doc/scripts/convert_yaml_to_adoc.py @@ -50,7 +50,8 @@ COMPLEX_OPTIONS = ( 'server_encryption_options', 'client_encryption_options', 'transparent_data_encryption_options', - 'hinted_handoff_disabled_datacenters' + 'hinted_handoff_disabled_datacenters', + 'startup_checks' ) def convert(yaml_file, dest_file): From b662744af59f3a3dfbfeb7314e29fecb93abfd80 Mon Sep 17 00:00:00 2001 From: Brandon Williams Date: Mon, 29 Jul 2024 08:47:20 -0500 Subject: [PATCH 2/6] Prepare debian changelog for 4.1.6 --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index dee930c08a..0dd72495b4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +cassandra (4.1.6) unstable; urgency=medium + + * New release + + -- Brandon Williams Mon, 29 Jul 2024 08:45:30 -0500 + cassandra (4.1.5) unstable; urgency=medium * New release From b8e08840ee676a4d94f643221627689241e5f51f Mon Sep 17 00:00:00 2001 From: Stefan Miklosovic Date: Tue, 2 Jan 2024 15:06:55 +0100 Subject: [PATCH 3/6] Do not spam log with SSLExceptions patch by Stefan Miklosovic; reviewed by Caleb Rackliffe for CASSANDRA-18839 Co-authored-by: James Hu --- CHANGES.txt | 1 + .../org/apache/cassandra/transport/ExceptionHandlers.java | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index d029c330ae..e8dd62d65d 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,5 @@ 4.0.14 + * Do not spam log with SSLExceptions (CASSANDRA-18839) * Fix schema.cql created by a snapshot after dropping more than one column (CASSANDRA-19747) * UnsupportedOperationException when reducing scope for LCS compactions (CASSANDRA-19704) * Make LWT conditions behavior on frozen and non-frozen columns consistent for null column values (CASSANDRA-19637) diff --git a/src/java/org/apache/cassandra/transport/ExceptionHandlers.java b/src/java/org/apache/cassandra/transport/ExceptionHandlers.java index 1c5c976172..e21d78e8f2 100644 --- a/src/java/org/apache/cassandra/transport/ExceptionHandlers.java +++ b/src/java/org/apache/cassandra/transport/ExceptionHandlers.java @@ -22,6 +22,8 @@ import java.io.IOException; import java.util.Set; import java.util.concurrent.TimeUnit; +import javax.net.ssl.SSLException; + import com.google.common.base.Predicate; import com.google.common.collect.ImmutableSet; @@ -104,6 +106,10 @@ public class ExceptionHandlers ClientMetrics.instance.markUnknownException(); logger.trace("Native exception in client networking", cause); } + else if (Throwables.anyCauseMatches(cause, t -> t instanceof SSLException)) + { + NoSpamLogger.log(logger, NoSpamLogger.Level.WARN, 1, TimeUnit.MINUTES, "SSLException in client networking with peer {} {}", ctx.channel().remoteAddress(), cause.getMessage()); + } else { ClientMetrics.instance.markUnknownException(); From ff3e5ab76d7ad1386e216eadaf8a1a7e8ea9e0b8 Mon Sep 17 00:00:00 2001 From: Alex Petrov Date: Fri, 9 Aug 2024 19:56:15 +0200 Subject: [PATCH 4/6] Ninja: Fix test merge after fixing CASSANDRA-19534 --- .../org/apache/cassandra/distributed/test/ReadRepairTest.java | 1 + 1 file changed, 1 insertion(+) diff --git a/test/distributed/org/apache/cassandra/distributed/test/ReadRepairTest.java b/test/distributed/org/apache/cassandra/distributed/test/ReadRepairTest.java index 9a70e897fe..0588d56b61 100644 --- a/test/distributed/org/apache/cassandra/distributed/test/ReadRepairTest.java +++ b/test/distributed/org/apache/cassandra/distributed/test/ReadRepairTest.java @@ -356,6 +356,7 @@ public class ReadRepairTest extends TestBaseImpl String key = "test1"; try (Cluster cluster = init(Cluster.build() .withConfig(config -> config.with(Feature.GOSSIP, Feature.NETWORK) + .set("native_transport_timeout", String.format("%dms", Integer.MAX_VALUE)) .set("read_request_timeout", String.format("%dms", Integer.MAX_VALUE))) .withTokenSupplier(TokenSupplier.evenlyDistributedTokens(4)) .withNodeIdTopology(NetworkTopology.singleDcNetworkTopology(4, "dc0", "rack0")) From 790de1079811278a2b431c2ced7c7ea02d290a25 Mon Sep 17 00:00:00 2001 From: Brandon Williams Date: Wed, 14 Aug 2024 11:01:05 -0500 Subject: [PATCH 5/6] Add note to NEWS about query handler interface --- NEWS.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/NEWS.txt b/NEWS.txt index 21bf7e76f3..5d7bf30ae9 100644 --- a/NEWS.txt +++ b/NEWS.txt @@ -51,6 +51,16 @@ restore snapshots created with the previous major version using the 'sstableloader' tool. You can upgrade the file format of your snapshots using the provided 'sstableupgrade' tool. +4.1.6 +===== + +Upgrading +--------- + - Note that the QueryHandler interface has been changed to accomodate + improved management of pending requests; any custom implementations + (using the cassandra.custom_query_handler_class system property) will + need to be recompiled. For further details, see CASSANDRA-19534. + 4.1.3 ===== From 93415c91af3d06504593a87c8b8d7e5d2d65b1ac Mon Sep 17 00:00:00 2001 From: Caleb Rackliffe Date: Tue, 13 Aug 2024 21:12:14 -0500 Subject: [PATCH 6/6] Use default commitlog settings in test YAMLs patch by Caleb Rackliffe; reviewed by David Capwell for CASSANDRA-19830 --- CHANGES.txt | 1 + test/conf/cassandra-murmur.yaml | 4 ++-- test/conf/cassandra-seeds.yaml | 4 ++-- test/conf/cassandra.yaml | 4 ++-- test/conf/unit-test-conf/test-native-port.yaml | 4 ++-- .../cassandra/distributed/impl/InstanceConfig.java | 7 +++---- .../distributed/test/RepairBoundaryTest.java | 1 - .../cassandra/distributed/test/RepairTest.java | 1 - .../test/ReplicaFilteringProtectionTest.java | 4 ++-- test/unit/org/apache/cassandra/cql3/CQLTester.java | 13 ++++++++++--- .../cassandra/db/commitlog/CommitLogReaderTest.java | 9 ++++++++- 11 files changed, 32 insertions(+), 20 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index e8dd62d65d..b2424f106f 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,5 @@ 4.0.14 + * Use default commitlog settings in test YAMLs (CASSANDRA-19830) * Do not spam log with SSLExceptions (CASSANDRA-18839) * Fix schema.cql created by a snapshot after dropping more than one column (CASSANDRA-19747) * UnsupportedOperationException when reducing scope for LCS compactions (CASSANDRA-19704) diff --git a/test/conf/cassandra-murmur.yaml b/test/conf/cassandra-murmur.yaml index 3c263a5af1..b64f6683c8 100644 --- a/test/conf/cassandra-murmur.yaml +++ b/test/conf/cassandra-murmur.yaml @@ -4,8 +4,8 @@ # cluster_name: Test Cluster memtable_allocation_type: heap_buffers -commitlog_sync: batch -commitlog_sync_batch_window_in_ms: 1.0 +commitlog_sync: periodic +commitlog_sync_period_in_ms: 10000 commitlog_segment_size_in_mb: 5 commitlog_directory: build/test/cassandra/commitlog cdc_raw_directory: build/test/cassandra/cdc_raw diff --git a/test/conf/cassandra-seeds.yaml b/test/conf/cassandra-seeds.yaml index f3279aeb12..675ac2bf51 100644 --- a/test/conf/cassandra-seeds.yaml +++ b/test/conf/cassandra-seeds.yaml @@ -5,8 +5,8 @@ cluster_name: Test Cluster # memtable_allocation_type: heap_buffers memtable_allocation_type: offheap_objects -commitlog_sync: batch -commitlog_sync_batch_window_in_ms: 1.0 +commitlog_sync: periodic +commitlog_sync_period_in_ms: 10000 commitlog_segment_size_in_mb: 5 commitlog_directory: build/test/cassandra/commitlog cdc_raw_directory: build/test/cassandra/cdc_raw diff --git a/test/conf/cassandra.yaml b/test/conf/cassandra.yaml index 7d4886d916..96946709f0 100644 --- a/test/conf/cassandra.yaml +++ b/test/conf/cassandra.yaml @@ -5,8 +5,8 @@ cluster_name: Test Cluster memtable_allocation_type: heap_buffers # memtable_allocation_type: offheap_objects -commitlog_sync: batch -commitlog_sync_batch_window_in_ms: 1.0 +commitlog_sync: periodic +commitlog_sync_period_in_ms: 10000 commitlog_segment_size_in_mb: 5 commitlog_directory: build/test/cassandra/commitlog # commitlog_compression: diff --git a/test/conf/unit-test-conf/test-native-port.yaml b/test/conf/unit-test-conf/test-native-port.yaml index b46525fa29..26cd518564 100644 --- a/test/conf/unit-test-conf/test-native-port.yaml +++ b/test/conf/unit-test-conf/test-native-port.yaml @@ -5,8 +5,8 @@ cluster_name: Test Cluster # memtable_allocation_type: heap_buffers memtable_allocation_type: offheap_objects -commitlog_sync: batch -commitlog_sync_batch_window_in_ms: 1.0 +commitlog_sync: periodic +commitlog_sync_period_in_ms: 10000 commitlog_segment_size_in_mb: 5 commitlog_directory: build/test/cassandra/commitlog # commitlog_compression: diff --git a/test/distributed/org/apache/cassandra/distributed/impl/InstanceConfig.java b/test/distributed/org/apache/cassandra/distributed/impl/InstanceConfig.java index d1714a33bf..5e4b0a24b3 100644 --- a/test/distributed/org/apache/cassandra/distributed/impl/InstanceConfig.java +++ b/test/distributed/org/apache/cassandra/distributed/impl/InstanceConfig.java @@ -105,7 +105,8 @@ public class InstanceConfig implements IInstanceConfig .set("memtable_flush_writers", 1) .set("concurrent_compactors", 1) .set("memtable_heap_space_in_mb", 10) - .set("commitlog_sync", "batch") + .set("commitlog_sync", "periodic") + .set("commitlog_sync_period_in_ms", 10000) .set("storage_port", storage_port) .set("native_transport_port", native_transport_port) .set("endpoint_snitch", DistributedTestSnitch.class.getName()) @@ -117,9 +118,7 @@ public class InstanceConfig implements IInstanceConfig // capacities that are based on `totalMemory` that should be fixed size .set("index_summary_capacity_in_mb", 50l) .set("counter_cache_size_in_mb", 50l) - .set("key_cache_size_in_mb", 50l) - // legacy parameters - .forceSet("commitlog_sync_batch_window_in_ms", 1.0); + .set("key_cache_size_in_mb", 50l); this.featureFlags = EnumSet.noneOf(Feature.class); this.jmxPort = jmx_port; } diff --git a/test/distributed/org/apache/cassandra/distributed/test/RepairBoundaryTest.java b/test/distributed/org/apache/cassandra/distributed/test/RepairBoundaryTest.java index d269bef64d..d21a0750ea 100644 --- a/test/distributed/org/apache/cassandra/distributed/test/RepairBoundaryTest.java +++ b/test/distributed/org/apache/cassandra/distributed/test/RepairBoundaryTest.java @@ -163,7 +163,6 @@ public class RepairBoundaryTest extends TestBaseImpl { cluster = Cluster.build(3) .withConfig(config -> config.set("hinted_handoff_enabled", false) - .set("commitlog_sync_batch_window_in_ms", 5) .set("num_tokens", 1) .set("initial_token", Long.toString(config.num() * 1000)) .with(NETWORK) diff --git a/test/distributed/org/apache/cassandra/distributed/test/RepairTest.java b/test/distributed/org/apache/cassandra/distributed/test/RepairTest.java index b127a74d21..2a9227f184 100644 --- a/test/distributed/org/apache/cassandra/distributed/test/RepairTest.java +++ b/test/distributed/org/apache/cassandra/distributed/test/RepairTest.java @@ -84,7 +84,6 @@ public class RepairTest extends TestBaseImpl { configModifier = configModifier.andThen( config -> config.set("hinted_handoff_enabled", false) - .set("commitlog_sync_batch_window_in_ms", 5) .with(NETWORK) .with(GOSSIP) ); diff --git a/test/distributed/org/apache/cassandra/distributed/test/ReplicaFilteringProtectionTest.java b/test/distributed/org/apache/cassandra/distributed/test/ReplicaFilteringProtectionTest.java index f891dfee5c..e919e77e54 100644 --- a/test/distributed/org/apache/cassandra/distributed/test/ReplicaFilteringProtectionTest.java +++ b/test/distributed/org/apache/cassandra/distributed/test/ReplicaFilteringProtectionTest.java @@ -57,7 +57,6 @@ public class ReplicaFilteringProtectionTest extends TestBaseImpl cluster = init(Cluster.build() .withNodes(REPLICAS) .withConfig(config -> config.set("hinted_handoff_enabled", false) - .set("commitlog_sync", "batch") .set("num_tokens", 1)).start()); // Make sure we start w/ the correct defaults: @@ -68,7 +67,8 @@ public class ReplicaFilteringProtectionTest extends TestBaseImpl @AfterClass public static void teardown() { - cluster.close(); + if (cluster != null) + cluster.close(); } @Test diff --git a/test/unit/org/apache/cassandra/cql3/CQLTester.java b/test/unit/org/apache/cassandra/cql3/CQLTester.java index dc2f334c08..48fddec68a 100644 --- a/test/unit/org/apache/cassandra/cql3/CQLTester.java +++ b/test/unit/org/apache/cassandra/cql3/CQLTester.java @@ -268,14 +268,21 @@ public abstract class CQLTester @BeforeClass public static void setUpClass() { - if (ROW_CACHE_SIZE_IN_MB > 0) - DatabaseDescriptor.setRowCacheSizeInMB(ROW_CACHE_SIZE_IN_MB); - StorageService.instance.setPartitionerUnsafe(Murmur3Partitioner.instance); + prePrepareServer(); // Once per-JVM is enough prepareServer(); } + protected static void prePrepareServer() + { + System.setProperty("cassandra.superuser_setup_delay_ms", "0"); + + if (ROW_CACHE_SIZE_IN_MB > 0) + DatabaseDescriptor.setRowCacheSizeInMB(ROW_CACHE_SIZE_IN_MB); + StorageService.instance.setPartitionerUnsafe(Murmur3Partitioner.instance); + } + @AfterClass public static void tearDownClass() { diff --git a/test/unit/org/apache/cassandra/db/commitlog/CommitLogReaderTest.java b/test/unit/org/apache/cassandra/db/commitlog/CommitLogReaderTest.java index 794f99f47b..45b1dd6644 100644 --- a/test/unit/org/apache/cassandra/db/commitlog/CommitLogReaderTest.java +++ b/test/unit/org/apache/cassandra/db/commitlog/CommitLogReaderTest.java @@ -43,10 +43,17 @@ import org.apache.cassandra.utils.KillerForTests; public class CommitLogReaderTest extends CQLTester { @BeforeClass - public static void beforeClass() + public static void setUpClass() { + prePrepareServer(); + DatabaseDescriptor.setCommitFailurePolicy(Config.CommitFailurePolicy.ignore); JVMStabilityInspector.replaceKiller(new KillerForTests(false)); + + DatabaseDescriptor.setCommitLogSync(Config.CommitLogSync.batch); + + // Once per-JVM is enough + prepareServer(); } @Before