Merge branch 'cassandra-4.1' into trunk

This commit is contained in:
Ekaterina Dimitrova 2022-07-25 10:15:30 -04:00
commit d2d6afb8e9
9 changed files with 25 additions and 5 deletions

View File

@ -18,6 +18,10 @@
* Add guardrail for ALTER TABLE ADD / DROP / REMOVE column operations (CASSANDRA-17495) * Add guardrail for ALTER TABLE ADD / DROP / REMOVE column operations (CASSANDRA-17495)
* Rename DisableFlag class to EnableFlag on guardrails (CASSANDRA-17544) * Rename DisableFlag class to EnableFlag on guardrails (CASSANDRA-17544)
Merged from 4.1: Merged from 4.1:
* Fix Settings Virtual Table to update paxos_variant after startup and rename enable_uuid_sstable_identifiers to
uuid_sstable_identifiers_enabled as per our config naming conventions (CASSANDRA-17738)
* index_summary_resize_interval_in_minutes = -1 is equivalent to index_summary_resize_interval being set to null or
disabled. JMX MBean IndexSummaryManager, setResizeIntervalInMinutes method still takes resizeIntervalInMinutes = -1 for disabled (CASSANDRA-17735)
* min_tracked_partition_size_bytes parameter from 4.1 alpha1 was renamed to min_tracked_partition_size (CASSANDRA-17733) * min_tracked_partition_size_bytes parameter from 4.1 alpha1 was renamed to min_tracked_partition_size (CASSANDRA-17733)
* Remove commons-lang dependency during build runtime (CASSANDRA-17724) * Remove commons-lang dependency during build runtime (CASSANDRA-17724)
* Relax synchronization on StreamSession#onError() to avoid deadlock (CASSANDRA-17706) * Relax synchronization on StreamSession#onError() to avoid deadlock (CASSANDRA-17706)

View File

@ -198,6 +198,7 @@ New features
Upgrading Upgrading
--------- ---------
- `enable_uuid_sstable_identifiers` parameter from 4.1 alpha1 was renamed to `uuid_sstable_identifiers_enabled`.
- `index_summary_resize_interval_in_minutes = -1` is equivalent to index_summary_resize_interval being set to `null` or - `index_summary_resize_interval_in_minutes = -1` is equivalent to index_summary_resize_interval being set to `null` or
disabled. JMX MBean `IndexSummaryManager`, `setResizeIntervalInMinutes` method still takes `resizeIntervalInMinutes = -1` for disabled. disabled. JMX MBean `IndexSummaryManager`, `setResizeIntervalInMinutes` method still takes `resizeIntervalInMinutes = -1` for disabled.
- min_tracked_partition_size_bytes parameter from 4.1 alpha1 was renamed to min_tracked_partition_size. - min_tracked_partition_size_bytes parameter from 4.1 alpha1 was renamed to min_tracked_partition_size.

View File

@ -1012,7 +1012,7 @@ sstable_preemptive_open_interval: 50MiB
# set to true, each newly created sstable will have a UUID based generation identifier and such files are # set to true, each newly created sstable will have a UUID based generation identifier and such files are
# not readable by previous Cassandra versions. At some point, this option will become true by default # not readable by previous Cassandra versions. At some point, this option will become true by default
# and eventually get removed from the configuration. # and eventually get removed from the configuration.
enable_uuid_sstable_identifiers: false uuid_sstable_identifiers_enabled: false
# When enabled, permits Cassandra to zero-copy stream entire eligible # When enabled, permits Cassandra to zero-copy stream entire eligible
# SSTables between nodes, including every component. # SSTables between nodes, including every component.

View File

@ -780,7 +780,7 @@ public class Config
public volatile boolean auto_optimise_preview_repair_streams = false; public volatile boolean auto_optimise_preview_repair_streams = false;
// see CASSANDRA-17048 and the comment in cassandra.yaml // see CASSANDRA-17048 and the comment in cassandra.yaml
public boolean enable_uuid_sstable_identifiers = false; public boolean uuid_sstable_identifiers_enabled = false;
/** /**
* Client mode means that the process is a pure client, that uses C* code base but does * Client mode means that the process is a pure client, that uses C* code base but does

View File

@ -4171,7 +4171,7 @@ public class DatabaseDescriptor
public static boolean isUUIDSSTableIdentifiersEnabled() public static boolean isUUIDSSTableIdentifiersEnabled()
{ {
return conf.enable_uuid_sstable_identifiers; return conf.uuid_sstable_identifiers_enabled;
} }
public static DurationSpec.LongNanosecondsBound getRepairStateExpires() public static DurationSpec.LongNanosecondsBound getRepairStateExpires()

View File

@ -605,7 +605,7 @@ public class StartupChecks
"UUID sstable identifiers are disabled but some sstables have been " + "UUID sstable identifiers are disabled but some sstables have been " +
"created with UUID identifiers. You have to either delete those " + "created with UUID identifiers. You have to either delete those " +
"sstables or enable UUID based sstable identifers in cassandra.yaml " + "sstables or enable UUID based sstable identifers in cassandra.yaml " +
"(enable_uuid_sstable_identifiers). The list of affected sstables is: " + "(uuid_sstable_identifiers_enabled). The list of affected sstables is: " +
Joiner.on(", ").join(withIllegalGenId) + ". If you decide to delete sstables, " + Joiner.on(", ").join(withIllegalGenId) + ". If you decide to delete sstables, " +
"and have that data replicated over other healthy nodes, those will be brought" + "and have that data replicated over other healthy nodes, those will be brought" +
"back during repair"); "back during repair");

View File

@ -1201,6 +1201,7 @@ public class Paxos
{ {
Preconditions.checkNotNull(paxosVariant); Preconditions.checkNotNull(paxosVariant);
PAXOS_VARIANT = paxosVariant; PAXOS_VARIANT = paxosVariant;
DatabaseDescriptor.setPaxosVariant(paxosVariant);
} }
public static Config.PaxosVariant getPaxosVariant() public static Config.PaxosVariant getPaxosVariant()

View File

@ -71,7 +71,7 @@ import static org.assertj.core.api.Assertions.assertThat;
public class SSTableIdGenerationTest extends TestBaseImpl public class SSTableIdGenerationTest extends TestBaseImpl
{ {
private final static String ENABLE_UUID_FIELD_NAME = "enable_uuid_sstable_identifiers"; private final static String ENABLE_UUID_FIELD_NAME = "uuid_sstable_identifiers_enabled";
private final static String SNAPSHOT_TAG = "test"; private final static String SNAPSHOT_TAG = "test";
private int v; private int v;

View File

@ -30,6 +30,7 @@ import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.apache.cassandra.ServerTestUtils; import org.apache.cassandra.ServerTestUtils;
import org.apache.cassandra.config.Config;
import org.apache.cassandra.config.DatabaseDescriptor; import org.apache.cassandra.config.DatabaseDescriptor;
import org.apache.cassandra.gms.EndpointState; import org.apache.cassandra.gms.EndpointState;
import org.apache.cassandra.gms.Gossiper; import org.apache.cassandra.gms.Gossiper;
@ -52,6 +53,19 @@ public class StorageProxyTest
ServerTestUtils.mkdirs(); ServerTestUtils.mkdirs();
} }
@Test
public void testSetGetPaxosVariant()
{
Assert.assertEquals(Config.PaxosVariant.v1, DatabaseDescriptor.getPaxosVariant());
Assert.assertEquals("v1", StorageProxy.instance.getPaxosVariant());
StorageProxy.instance.setPaxosVariant("v2");
Assert.assertEquals("v2", StorageProxy.instance.getPaxosVariant());
Assert.assertEquals(Config.PaxosVariant.v2, DatabaseDescriptor.getPaxosVariant());
DatabaseDescriptor.setPaxosVariant(Config.PaxosVariant.v1);
Assert.assertEquals(Config.PaxosVariant.v1, DatabaseDescriptor.getPaxosVariant());
Assert.assertEquals(Config.PaxosVariant.v1, DatabaseDescriptor.getPaxosVariant());
}
@Test @Test
public void testShouldHint() throws Exception public void testShouldHint() throws Exception
{ {