Merge branch 'cassandra-4.1' into cassandra-5.0.0

* cassandra-4.1:
  Use default commitlog settings in test YAMLs
This commit is contained in:
Caleb Rackliffe 2024-08-15 10:24:12 -05:00
commit c91ffe8a9f
23 changed files with 65 additions and 25 deletions

View File

@ -1,6 +1,8 @@
5.0-rc2 5.0-rc2
* Fix direct IO support always being evaluated to false upon the first start of a node (CASSANDRA-19779) * Fix direct IO support always being evaluated to false upon the first start of a node (CASSANDRA-19779)
* Memtable allocation type unslabbed_heap_buffers_logged will cause an assertion error for TrieMemtables and SegmentedTrieMemtables (CASSANDRA-19835) * Memtable allocation type unslabbed_heap_buffers_logged will cause an assertion error for TrieMemtables and SegmentedTrieMemtables (CASSANDRA-19835)
Merged from 4.0:
* Use default commitlog settings in test YAMLs (CASSANDRA-19830)
5.0-rc1 5.0-rc1

View File

@ -21,7 +21,8 @@
# #
cluster_name: Test Cluster cluster_name: Test Cluster
memtable_allocation_type: offheap_objects memtable_allocation_type: offheap_objects
commitlog_sync: batch commitlog_sync: periodic
commitlog_sync_period: 10s
commitlog_segment_size: 5MiB commitlog_segment_size: 5MiB
commitlog_directory: build/test/cassandra/commitlog commitlog_directory: build/test/cassandra/commitlog
cdc_raw_directory: build/test/cassandra/cdc_raw cdc_raw_directory: build/test/cassandra/cdc_raw

View File

@ -21,7 +21,8 @@
# #
cluster_name: Test Cluster cluster_name: Test Cluster
memtable_allocation_type: offheap_objects memtable_allocation_type: offheap_objects
commitlog_sync: batch commitlog_sync: periodic
commitlog_sync_period: 10s
commitlog_segment_size: 5MiB commitlog_segment_size: 5MiB
commitlog_directory: build/test/cassandra/commitlog commitlog_directory: build/test/cassandra/commitlog
cdc_raw_directory: build/test/cassandra/cdc_raw cdc_raw_directory: build/test/cassandra/cdc_raw

View File

@ -4,7 +4,8 @@
# #
cluster_name: Test Cluster cluster_name: Test Cluster
memtable_allocation_type: heap_buffers memtable_allocation_type: heap_buffers
commitlog_sync: batch commitlog_sync: periodic
commitlog_sync_period: 10s
commitlog_segment_size: 5MiB commitlog_segment_size: 5MiB
commitlog_directory: build/test/cassandra/commitlog commitlog_directory: build/test/cassandra/commitlog
cdc_raw_directory: build/test/cassandra/cdc_raw cdc_raw_directory: build/test/cassandra/cdc_raw

View File

@ -5,7 +5,8 @@
cluster_name: Test Cluster cluster_name: Test Cluster
# memtable_allocation_type: heap_buffers # memtable_allocation_type: heap_buffers
memtable_allocation_type: offheap_objects memtable_allocation_type: offheap_objects
commitlog_sync: batch commitlog_sync: periodic
commitlog_sync_period: 10s
commitlog_segment_size_in_mb: 5 commitlog_segment_size_in_mb: 5
commitlog_directory: build/test/cassandra/commitlog commitlog_directory: build/test/cassandra/commitlog
# commitlog_compression: # commitlog_compression:

View File

@ -23,7 +23,8 @@
cluster_name: Test Cluster cluster_name: Test Cluster
# memtable_allocation_type: heap_buffers # memtable_allocation_type: heap_buffers
memtable_allocation_type: offheap_objects memtable_allocation_type: offheap_objects
commitlog_sync: batch commitlog_sync: periodic
commitlog_sync_period: 10s
commitlog_segment_size: 5MiB commitlog_segment_size: 5MiB
commitlog_directory: build/test/cassandra/commitlog commitlog_directory: build/test/cassandra/commitlog
# commitlog_compression: # commitlog_compression:

View File

@ -23,7 +23,8 @@
cluster_name: Test Cluster cluster_name: Test Cluster
# memtable_allocation_type: heap_buffers # memtable_allocation_type: heap_buffers
memtable_allocation_type: offheap_objects memtable_allocation_type: offheap_objects
commitlog_sync: batch commitlog_sync: periodic
commitlog_sync_period: 10s
commitlog_segment_size: 5MiB commitlog_segment_size: 5MiB
commitlog_directory: build/test/cassandra/commitlog commitlog_directory: build/test/cassandra/commitlog
# commitlog_compression: # commitlog_compression:

View File

@ -23,7 +23,8 @@
cluster_name: Test Cluster cluster_name: Test Cluster
# memtable_allocation_type: heap_buffers # memtable_allocation_type: heap_buffers
memtable_allocation_type: offheap_objects memtable_allocation_type: offheap_objects
commitlog_sync: batch commitlog_sync: periodic
commitlog_sync_period: 10s
commitlog_segment_size: 5MiB commitlog_segment_size: 5MiB
commitlog_directory: build/test/cassandra/commitlog commitlog_directory: build/test/cassandra/commitlog
# commitlog_compression: # commitlog_compression:

View File

@ -23,7 +23,8 @@
cluster_name: Test Cluster cluster_name: Test Cluster
# memtable_allocation_type: heap_buffers # memtable_allocation_type: heap_buffers
memtable_allocation_type: offheap_objects memtable_allocation_type: offheap_objects
commitlog_sync: batch commitlog_sync: periodic
commitlog_sync_period: 10s
commitlog_segment_size: 5MiB commitlog_segment_size: 5MiB
commitlog_directory: build/test/cassandra/commitlog commitlog_directory: build/test/cassandra/commitlog
# commitlog_compression: # commitlog_compression:

View File

@ -23,7 +23,8 @@
cluster_name: Test Cluster cluster_name: Test Cluster
# memtable_allocation_type: heap_buffers # memtable_allocation_type: heap_buffers
memtable_allocation_type: offheap_objects memtable_allocation_type: offheap_objects
commitlog_sync: batch commitlog_sync: periodic
commitlog_sync_period: 10s
commitlog_segment_size: 5MiB commitlog_segment_size: 5MiB
commitlog_directory: build/test/cassandra/commitlog commitlog_directory: build/test/cassandra/commitlog
# commitlog_compression: # commitlog_compression:

View File

@ -5,7 +5,8 @@
cluster_name: Test Cluster cluster_name: Test Cluster
# memtable_allocation_type: heap_buffers # memtable_allocation_type: heap_buffers
memtable_allocation_type: offheap_objects memtable_allocation_type: offheap_objects
commitlog_sync: batch commitlog_sync: periodic
commitlog_sync_period: 10s
commitlog_segment_size: 5MiB commitlog_segment_size: 5MiB
commitlog_directory: build/test/cassandra/commitlog commitlog_directory: build/test/cassandra/commitlog
cdc_raw_directory: build/test/cassandra/cdc_raw cdc_raw_directory: build/test/cassandra/cdc_raw

View File

@ -23,7 +23,8 @@
cluster_name: Test Cluster cluster_name: Test Cluster
# memtable_allocation_type: heap_buffers # memtable_allocation_type: heap_buffers
memtable_allocation_type: offheap_objects memtable_allocation_type: offheap_objects
commitlog_sync: batch commitlog_sync: periodic
commitlog_sync_period: 10s
commitlog_segment_size: 5MiB commitlog_segment_size: 5MiB
commitlog_directory: build/test/cassandra/commitlog commitlog_directory: build/test/cassandra/commitlog
# commitlog_compression: # commitlog_compression:

View File

@ -23,7 +23,8 @@
cluster_name: Test Cluster cluster_name: Test Cluster
# memtable_allocation_type: heap_buffers # memtable_allocation_type: heap_buffers
memtable_allocation_type: offheap_objects memtable_allocation_type: offheap_objects
commitlog_sync: batch commitlog_sync: periodic
commitlog_sync_period: 10s
commitlog_segment_size: 5MiB commitlog_segment_size: 5MiB
commitlog_directory: build/test/cassandra/commitlog commitlog_directory: build/test/cassandra/commitlog
# commitlog_compression: # commitlog_compression:

View File

@ -5,7 +5,8 @@
cluster_name: Test Cluster cluster_name: Test Cluster
memtable_allocation_type: heap_buffers memtable_allocation_type: heap_buffers
# memtable_allocation_type: offheap_objects # memtable_allocation_type: offheap_objects
commitlog_sync: batch commitlog_sync: periodic
commitlog_sync_period: 10s
commitlog_segment_size: 5MiB commitlog_segment_size: 5MiB
commitlog_directory: build/test/cassandra/commitlog commitlog_directory: build/test/cassandra/commitlog
commitlog_disk_access_mode: legacy commitlog_disk_access_mode: legacy

View File

@ -5,7 +5,8 @@
cluster_name: Test Cluster cluster_name: Test Cluster
# memtable_allocation_type: heap_buffers # memtable_allocation_type: heap_buffers
memtable_allocation_type: offheap_objects memtable_allocation_type: offheap_objects
commitlog_sync: batch commitlog_sync: periodic
commitlog_sync_period: 10s
commitlog_segment_size: 5MiB commitlog_segment_size: 5MiB
commitlog_directory: build/test/cassandra/commitlog commitlog_directory: build/test/cassandra/commitlog
# commitlog_compression: # commitlog_compression:

View File

@ -101,7 +101,8 @@ public class InstanceConfig implements IInstanceConfig
.set("memtable_flush_writers", 1) .set("memtable_flush_writers", 1)
.set("concurrent_compactors", 1) .set("concurrent_compactors", 1)
.set("memtable_heap_space", "10MiB") .set("memtable_heap_space", "10MiB")
.set("commitlog_sync", "batch") .set("commitlog_sync", "periodic")
.set("commitlog_sync_period_in_ms", 10000)
.set("storage_port", storage_port) .set("storage_port", storage_port)
.set("native_transport_port", native_transport_port) .set("native_transport_port", native_transport_port)
.set("endpoint_snitch", DistributedTestSnitch.class.getName()) .set("endpoint_snitch", DistributedTestSnitch.class.getName())

View File

@ -57,8 +57,7 @@ public class ReplicaFilteringProtectionTest extends TestBaseImpl
{ {
cluster = init(Cluster.build() cluster = init(Cluster.build()
.withNodes(REPLICAS) .withNodes(REPLICAS)
.withConfig(config -> config.set("hinted_handoff_enabled", false) .withConfig(config -> config.set("hinted_handoff_enabled", false)).start());
.set("commitlog_sync", "batch")).start());
// Make sure we start w/ the correct defaults: // Make sure we start w/ the correct defaults:
cluster.get(1).runOnInstance(() -> assertEquals(DEFAULT_WARN_THRESHOLD, StorageService.instance.getCachedReplicaRowsWarnThreshold())); cluster.get(1).runOnInstance(() -> assertEquals(DEFAULT_WARN_THRESHOLD, StorageService.instance.getCachedReplicaRowsWarnThreshold()));

View File

@ -51,6 +51,7 @@ import org.apache.cassandra.distributed.api.IIsolatedExecutor.SerializableBiCons
import org.apache.cassandra.distributed.api.IIsolatedExecutor.SerializableConsumer; import org.apache.cassandra.distributed.api.IIsolatedExecutor.SerializableConsumer;
import org.apache.cassandra.distributed.api.IIsolatedExecutor.SerializableRunnable; import org.apache.cassandra.distributed.api.IIsolatedExecutor.SerializableRunnable;
import org.apache.cassandra.distributed.impl.DirectStreamingConnectionFactory; import org.apache.cassandra.distributed.impl.DirectStreamingConnectionFactory;
import org.apache.cassandra.distributed.impl.InstanceConfig;
import org.apache.cassandra.distributed.impl.IsolatedExecutor; import org.apache.cassandra.distributed.impl.IsolatedExecutor;
import org.apache.cassandra.io.compress.LZ4Compressor; import org.apache.cassandra.io.compress.LZ4Compressor;
import org.apache.cassandra.io.util.FileSystems; import org.apache.cassandra.io.util.FileSystems;
@ -686,7 +687,17 @@ public class ClusterSimulation<S extends Simulation> implements AutoCloseable
.set("file_cache_size", "16MiB") .set("file_cache_size", "16MiB")
.set("use_deterministic_table_id", true) .set("use_deterministic_table_id", true)
.set("disk_access_mode", disk_access_mode) .set("disk_access_mode", disk_access_mode)
.set("failure_detector", SimulatedFailureDetector.Instance.class.getName()); .set("failure_detector", SimulatedFailureDetector.Instance.class.getName())
.set("commitlog_sync", "batch");
// TODO: Add remove() to IInstanceConfig
if (config instanceof InstanceConfig)
{
InstanceConfig instanceConfig = (InstanceConfig) config;
instanceConfig.remove("commitlog_sync_period_in_ms");
instanceConfig.remove("commitlog_sync_period");
}
if (commitlogCompressed) if (commitlogCompressed)
config.set("commitlog_compression", new ParameterizedClass(LZ4Compressor.class.getName(), emptyMap())); config.set("commitlog_compression", new ParameterizedClass(LZ4Compressor.class.getName(), emptyMap()));
configUpdater.accept(threadAllocator.update(config)); configUpdater.accept(threadAllocator.update(config));

View File

@ -42,7 +42,8 @@ public class FailStartupDuplicateParamsTest
{ {
private static final List<String> baseConfig = ImmutableList.of( private static final List<String> baseConfig = ImmutableList.of(
"cluster_name: Test Cluster", "cluster_name: Test Cluster",
"commitlog_sync: batch", "commitlog_sync: periodic",
"commitlog_sync_period: 10s",
"commitlog_directory: build/test/cassandra/commitlog", "commitlog_directory: build/test/cassandra/commitlog",
"hints_directory: build/test/cassandra/hints", "hints_directory: build/test/cassandra/hints",
"partitioner: org.apache.cassandra.dht.ByteOrderedPartitioner", "partitioner: org.apache.cassandra.dht.ByteOrderedPartitioner",

View File

@ -80,7 +80,7 @@ public class LoadOldYAMLBackwardCompatibilityTest
assertEquals(new DataRateSpec.LongBytesPerSecondBound(24L * 1024L * 1024L), config.inter_dc_stream_throughput_outbound); assertEquals(new DataRateSpec.LongBytesPerSecondBound(24L * 1024L * 1024L), config.inter_dc_stream_throughput_outbound);
assertNull(config.commitlog_total_space); assertNull(config.commitlog_total_space);
assertEquals(new DurationSpec.IntMillisecondsBound(0.0, TimeUnit.MILLISECONDS), config.commitlog_sync_group_window); assertEquals(new DurationSpec.IntMillisecondsBound(0.0, TimeUnit.MILLISECONDS), config.commitlog_sync_group_window);
assertEquals(new DurationSpec.IntMillisecondsBound(0), config.commitlog_sync_period); assertEquals(new DurationSpec.IntMillisecondsBound(10000), config.commitlog_sync_period);
assertEquals(new DataStorageSpec.IntMebibytesBound(5), config.commitlog_segment_size); assertEquals(new DataStorageSpec.IntMebibytesBound(5), config.commitlog_segment_size);
assertNull(config.periodic_commitlog_sync_lag_block); //Integer assertNull(config.periodic_commitlog_sync_lag_block); //Integer
assertNull(config.max_mutation_size); assertNull(config.max_mutation_size);

View File

@ -53,7 +53,7 @@ public class ParseAndConvertUnitsTest
assertEquals(new DurationSpec.IntMillisecondsBound(2000), config.internode_tcp_connect_timeout); assertEquals(new DurationSpec.IntMillisecondsBound(2000), config.internode_tcp_connect_timeout);
assertEquals(new DurationSpec.IntMillisecondsBound(30000), config.internode_tcp_user_timeout); assertEquals(new DurationSpec.IntMillisecondsBound(30000), config.internode_tcp_user_timeout);
assertEquals(new DurationSpec.IntMillisecondsBound(0), config.commitlog_sync_group_window); assertEquals(new DurationSpec.IntMillisecondsBound(0), config.commitlog_sync_group_window);
assertEquals(new DurationSpec.IntMillisecondsBound(0), config.commitlog_sync_period); assertEquals(new DurationSpec.IntMillisecondsBound(10000), config.commitlog_sync_period);
assertNull(config.periodic_commitlog_sync_lag_block); assertNull(config.periodic_commitlog_sync_lag_block);
assertEquals(new DurationSpec.IntMillisecondsBound(250), config.cdc_free_space_check_interval); assertEquals(new DurationSpec.IntMillisecondsBound(250), config.cdc_free_space_check_interval);
assertEquals(new DurationSpec.IntMillisecondsBound(100), config.dynamic_snitch_update_interval); assertEquals(new DurationSpec.IntMillisecondsBound(100), config.dynamic_snitch_update_interval);

View File

@ -399,6 +399,14 @@ public abstract class CQLTester
@BeforeClass @BeforeClass
public static void setUpClass() public static void setUpClass()
{
prePrepareServer();
// Once per-JVM is enough
prepareServer();
}
protected static void prePrepareServer()
{ {
CassandraRelevantProperties.SUPERUSER_SETUP_DELAY_MS.setLong(0); CassandraRelevantProperties.SUPERUSER_SETUP_DELAY_MS.setLong(0);
ServerTestUtils.daemonInitialization(); ServerTestUtils.daemonInitialization();
@ -406,9 +414,6 @@ public abstract class CQLTester
if (ROW_CACHE_SIZE_IN_MIB > 0) if (ROW_CACHE_SIZE_IN_MIB > 0)
DatabaseDescriptor.setRowCacheSizeInMiB(ROW_CACHE_SIZE_IN_MIB); DatabaseDescriptor.setRowCacheSizeInMiB(ROW_CACHE_SIZE_IN_MIB);
StorageService.instance.setPartitionerUnsafe(Murmur3Partitioner.instance); StorageService.instance.setPartitionerUnsafe(Murmur3Partitioner.instance);
// Once per-JVM is enough
prepareServer();
} }
@AfterClass @AfterClass

View File

@ -44,10 +44,17 @@ import org.apache.cassandra.utils.KillerForTests;
public class CommitLogReaderTest extends CQLTester public class CommitLogReaderTest extends CQLTester
{ {
@BeforeClass @BeforeClass
public static void beforeClass() public static void setUpClass()
{ {
prePrepareServer();
DatabaseDescriptor.setCommitFailurePolicy(Config.CommitFailurePolicy.ignore); DatabaseDescriptor.setCommitFailurePolicy(Config.CommitFailurePolicy.ignore);
JVMStabilityInspector.replaceKiller(new KillerForTests(false)); JVMStabilityInspector.replaceKiller(new KillerForTests(false));
DatabaseDescriptor.setCommitLogSync(Config.CommitLogSync.batch);
// Once per-JVM is enough
prepareServer();
} }
@Before @Before