mirror of https://github.com/apache/cassandra
ninja-fix: Make sure the MutationJournal starts before trying to create tracked keyspaces in unit-level tests that call SchemaLoader.schemaDefinition()
This commit is contained in:
parent
78466146f8
commit
567e93ba3b
|
|
@ -53,6 +53,7 @@ import org.apache.cassandra.io.compress.LZ4Compressor;
|
|||
import org.apache.cassandra.io.compress.SnappyCompressor;
|
||||
import org.apache.cassandra.io.util.DataInputBuffer;
|
||||
import org.apache.cassandra.io.util.DataInputPlus;
|
||||
import org.apache.cassandra.replication.MutationJournal;
|
||||
import org.apache.cassandra.schema.Schema;
|
||||
import org.apache.cassandra.security.EncryptionContext;
|
||||
import org.apache.cassandra.security.EncryptionContextGenerator;
|
||||
|
|
@ -118,6 +119,7 @@ public abstract class CommitLogStressTest
|
|||
}
|
||||
|
||||
SchemaLoader.loadSchema();
|
||||
MutationJournal.instance.start();
|
||||
SchemaLoader.schemaDefinition(""); // leave def. blank to maintain old behaviour
|
||||
|
||||
CommitLog.instance.stopUnsafe(true);
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ import org.apache.cassandra.net.IVerbHandler;
|
|||
import org.apache.cassandra.net.Message;
|
||||
import org.apache.cassandra.net.MessagingService;
|
||||
import org.apache.cassandra.net.Verb;
|
||||
import org.apache.cassandra.replication.MutationJournal;
|
||||
import org.apache.cassandra.schema.ColumnMetadata;
|
||||
import org.apache.cassandra.schema.Schema;
|
||||
import org.apache.cassandra.schema.TableMetadata;
|
||||
|
|
@ -76,6 +77,7 @@ public class MutationVerbHandlerOutOfRangeTest
|
|||
public static void init() throws Exception
|
||||
{
|
||||
ServerTestUtils.prepareServerNoRegister();
|
||||
MutationJournal.instance.start();
|
||||
SchemaLoader.schemaDefinition(TEST_NAME);
|
||||
ServerTestUtils.markCMS();
|
||||
StorageService.instance.unsafeSetInitialized();
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ import org.apache.cassandra.metrics.StorageMetrics;
|
|||
import org.apache.cassandra.net.Message;
|
||||
import org.apache.cassandra.net.MessagingService;
|
||||
import org.apache.cassandra.net.Verb;
|
||||
import org.apache.cassandra.replication.MutationJournal;
|
||||
import org.apache.cassandra.schema.Schema;
|
||||
import org.apache.cassandra.schema.TableMetadata;
|
||||
import org.apache.cassandra.service.StorageService;
|
||||
|
|
@ -75,6 +76,7 @@ public class ReadCommandVerbHandlerOutOfRangeTest
|
|||
public static void init() throws Throwable
|
||||
{
|
||||
ServerTestUtils.prepareServerNoRegister();
|
||||
MutationJournal.instance.start();
|
||||
SchemaLoader.schemaDefinition(TEST_NAME);
|
||||
ServerTestUtils.markCMS();
|
||||
metadata_nonreplicated = Schema.instance.getTableMetadata(KEYSPACE_NONREPLICATED, TABLE);
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ import org.apache.cassandra.net.Message;
|
|||
import org.apache.cassandra.net.MessageFlag;
|
||||
import org.apache.cassandra.net.MessagingService;
|
||||
import org.apache.cassandra.net.ParamType;
|
||||
import org.apache.cassandra.replication.MutationJournal;
|
||||
import org.apache.cassandra.schema.Schema;
|
||||
import org.apache.cassandra.schema.TableMetadata;
|
||||
import org.apache.cassandra.tcm.membership.NodeAddresses;
|
||||
|
|
@ -72,6 +73,7 @@ public class ReadCommandVerbHandlerTest
|
|||
public static void init() throws Throwable
|
||||
{
|
||||
ServerTestUtils.prepareServerNoRegister();
|
||||
MutationJournal.instance.start();
|
||||
SchemaLoader.schemaDefinition(TEST_NAME);
|
||||
metadata = Schema.instance.getTableMetadata(KEYSPACE, TABLE);
|
||||
metadata_with_transient = Schema.instance.getTableMetadata(KEYSPACE_WITH_TRANSIENT, TABLE);
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@ import org.apache.cassandra.gms.IFailureDetectionEventListener;
|
|||
import org.apache.cassandra.gms.IFailureDetector;
|
||||
import org.apache.cassandra.locator.InetAddressAndPort;
|
||||
import org.apache.cassandra.locator.Replica;
|
||||
import org.apache.cassandra.replication.MutationJournal;
|
||||
import org.apache.cassandra.schema.Schema;
|
||||
import org.apache.cassandra.schema.SchemaConstants;
|
||||
import org.apache.cassandra.service.StorageService;
|
||||
|
|
@ -92,6 +93,7 @@ public class BootStrapperTest
|
|||
oldPartitioner = StorageService.instance.setPartitionerUnsafe(Murmur3Partitioner.instance);
|
||||
ServerTestUtils.prepareServerNoRegister();
|
||||
SchemaLoader.startGossiper();
|
||||
MutationJournal.instance.start();
|
||||
SchemaLoader.schemaDefinition("BootStrapperTest");
|
||||
RangeStreamer.ALIVE_PREDICATE = Predicates.alwaysTrue();
|
||||
ServerTestUtils.markCMS();
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ import org.apache.cassandra.repair.messages.RepairMessage;
|
|||
import org.apache.cassandra.repair.messages.ValidationResponse;
|
||||
import org.apache.cassandra.repair.messages.ValidationRequest;
|
||||
import org.apache.cassandra.repair.state.ParticipateState;
|
||||
import org.apache.cassandra.replication.MutationJournal;
|
||||
import org.apache.cassandra.schema.Schema;
|
||||
import org.apache.cassandra.schema.TableId;
|
||||
import org.apache.cassandra.service.ActiveRepairService;
|
||||
|
|
@ -83,6 +84,7 @@ public class RepairMessageVerbHandlerOutOfRangeTest
|
|||
SchemaLoader.loadSchema();
|
||||
DatabaseDescriptor.setPartitionerUnsafe(Murmur3Partitioner.instance);
|
||||
ServerTestUtils.recreateCMS();
|
||||
MutationJournal.instance.start();
|
||||
SchemaLoader.schemaDefinition(TEST_NAME);
|
||||
ClusterMetadataTestHelper.register(broadcastAddress);
|
||||
ServerTestUtils.markCMS();
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ import org.apache.cassandra.distributed.test.log.ClusterMetadataTestHelper;
|
|||
import org.apache.cassandra.exceptions.ConfigurationException;
|
||||
import org.apache.cassandra.index.SecondaryIndexManager;
|
||||
import org.apache.cassandra.index.StubIndex;
|
||||
import org.apache.cassandra.replication.MutationJournal;
|
||||
import org.apache.cassandra.tcm.ClusterMetadata;
|
||||
import org.apache.cassandra.utils.FBUtilities;
|
||||
|
||||
|
|
@ -45,6 +46,7 @@ public class JoinTokenRingTest
|
|||
DatabaseDescriptor.daemonInitialization();
|
||||
ServerTestUtils.prepareServerNoRegister();
|
||||
SchemaLoader.startGossiper();
|
||||
MutationJournal.instance.start();
|
||||
SchemaLoader.schemaDefinition("JoinTokenRingTest");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ import java.nio.ByteBuffer;
|
|||
|
||||
import com.google.common.collect.Iterables;
|
||||
|
||||
import org.apache.cassandra.replication.MutationJournal;
|
||||
import org.apache.cassandra.schema.TableMetadata;
|
||||
import org.apache.cassandra.service.paxos.Ballot;
|
||||
import org.apache.cassandra.service.paxos.v1.PrepareVerbHandler;
|
||||
|
|
@ -63,6 +64,7 @@ public class PaxosStateTest
|
|||
public static void setUpClass() throws Throwable
|
||||
{
|
||||
SchemaLoader.loadSchema();
|
||||
MutationJournal.instance.start();
|
||||
SchemaLoader.schemaDefinition("PaxosStateTest");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ import org.apache.cassandra.locator.ReplicaCollection;
|
|||
import org.apache.cassandra.locator.ReplicaLayout;
|
||||
import org.apache.cassandra.locator.ReplicaPlan;
|
||||
import org.apache.cassandra.locator.ReplicaPlans;
|
||||
import org.apache.cassandra.replication.MutationJournal;
|
||||
import org.apache.cassandra.schema.KeyspaceParams;
|
||||
import org.apache.cassandra.tcm.Epoch;
|
||||
import org.apache.cassandra.utils.ByteBufferUtil;
|
||||
|
|
@ -88,6 +89,7 @@ public class WriteResponseHandlerTransientTest
|
|||
public static void setupClass() throws Throwable
|
||||
{
|
||||
SchemaLoader.loadSchema();
|
||||
MutationJournal.instance.start();
|
||||
DatabaseDescriptor.setMutationTrackingEnabled(true);
|
||||
DatabaseDescriptor.setTransientReplicationEnabledUnsafe(true);
|
||||
DatabaseDescriptor.setPartitionerUnsafe(Murmur3Partitioner.instance);
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ import java.util.function.Function;
|
|||
import com.google.common.collect.Iterables;
|
||||
|
||||
import org.apache.cassandra.config.DatabaseDescriptor;
|
||||
import org.apache.cassandra.replication.MutationJournal;
|
||||
import org.apache.cassandra.schema.TableMetadata;
|
||||
|
||||
import org.junit.AfterClass;
|
||||
|
|
@ -56,6 +57,7 @@ public class PaxosStateTest
|
|||
public static void setUpClass() throws Throwable
|
||||
{
|
||||
SchemaLoader.loadSchema();
|
||||
MutationJournal.instance.start();
|
||||
SchemaLoader.schemaDefinition("PaxosStateTest");
|
||||
metadata = Keyspace.open("PaxosStateTestKeyspace1").getColumnFamilyStore("Standard1").metadata.get();
|
||||
metadata.withSwapped(metadata.params.unbuild().gcGraceSeconds(3600).build());
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ import org.apache.cassandra.metrics.StorageMetrics;
|
|||
import org.apache.cassandra.net.Message;
|
||||
import org.apache.cassandra.net.MessagingService;
|
||||
import org.apache.cassandra.net.Verb;
|
||||
import org.apache.cassandra.replication.MutationJournal;
|
||||
import org.apache.cassandra.schema.Schema;
|
||||
import org.apache.cassandra.schema.TableMetadata;
|
||||
import org.apache.cassandra.service.StorageService;
|
||||
|
|
@ -75,6 +76,7 @@ public class PaxosVerbHandlerOutOfRangeTest // PaxosV1 out of range tests - V2 i
|
|||
public static void init() throws Exception
|
||||
{
|
||||
ServerTestUtils.prepareServerNoRegister();
|
||||
MutationJournal.instance.start();
|
||||
SchemaLoader.schemaDefinition(TEST_NAME);
|
||||
ServerTestUtils.markCMS();
|
||||
StorageService.instance.unsafeSetInitialized();
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ import org.apache.cassandra.db.filter.DataLimits;
|
|||
import org.apache.cassandra.db.filter.RowFilter;
|
||||
import org.apache.cassandra.locator.InetAddressAndPort;
|
||||
import org.apache.cassandra.metrics.TableMetrics;
|
||||
import org.apache.cassandra.replication.MutationJournal;
|
||||
import org.apache.cassandra.schema.Schema;
|
||||
import org.apache.cassandra.schema.TableMetadata;
|
||||
import org.apache.cassandra.utils.ByteBufferUtil;
|
||||
|
|
@ -61,6 +62,7 @@ public class RepairedDataVerifierTest
|
|||
public static void init()
|
||||
{
|
||||
SchemaLoader.loadSchema();
|
||||
MutationJournal.instance.start();
|
||||
SchemaLoader.schemaDefinition(TEST_NAME);
|
||||
DatabaseDescriptor.reportUnconfirmedRepairedDataMismatches(true);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,6 +65,7 @@ import org.apache.cassandra.metrics.StorageMetrics;
|
|||
import org.apache.cassandra.net.AsyncStreamingOutputPlus;
|
||||
import org.apache.cassandra.net.MessagingService;
|
||||
import org.apache.cassandra.replication.ImmutableCoordinatorLogOffsets;
|
||||
import org.apache.cassandra.replication.MutationJournal;
|
||||
import org.apache.cassandra.schema.TableMetadata;
|
||||
import org.apache.cassandra.streaming.async.StreamCompressionSerializer;
|
||||
import org.apache.cassandra.streaming.messages.StreamMessageHeader;
|
||||
|
|
@ -95,6 +96,7 @@ public class StreamReaderTest
|
|||
DatabaseDescriptor.daemonInitialization();
|
||||
DatabaseDescriptor.setPartitionerUnsafe(Murmur3Partitioner.instance);
|
||||
ServerTestUtils.prepareServerNoRegister();
|
||||
MutationJournal.instance.start();
|
||||
SchemaLoader.schemaDefinition(TEST_NAME);
|
||||
ServerTestUtils.markCMS();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ import org.apache.cassandra.distributed.test.log.ClusterMetadataTestHelper;
|
|||
import org.apache.cassandra.locator.InetAddressAndPort;
|
||||
import org.apache.cassandra.locator.RangesAtEndpoint;
|
||||
import org.apache.cassandra.metrics.StorageMetrics;
|
||||
import org.apache.cassandra.replication.MutationJournal;
|
||||
import org.apache.cassandra.service.StorageService;
|
||||
import org.apache.cassandra.streaming.messages.SessionFailedMessage;
|
||||
import org.apache.cassandra.streaming.messages.StreamMessage;
|
||||
|
|
@ -73,6 +74,7 @@ public class StreamSessionOwnedRangesTest
|
|||
SchemaLoader.loadSchema();
|
||||
DatabaseDescriptor.setPartitionerUnsafe(Murmur3Partitioner.instance);
|
||||
ServerTestUtils.recreateCMS();
|
||||
MutationJournal.instance.start();
|
||||
SchemaLoader.schemaDefinition(TEST_NAME);
|
||||
ClusterMetadataTestHelper.register(broadcastAddress);
|
||||
ServerTestUtils.markCMS();
|
||||
|
|
|
|||
Loading…
Reference in New Issue