You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by ja...@apache.org on 2016/01/16 04:16:01 UTC

cassandra git commit: CommitLogUpgradeTestMaker creates broken commit logs for > 3.0

Repository: cassandra
Updated Branches:
  refs/heads/trunk b1d063dc2 -> 8f8801515


CommitLogUpgradeTestMaker creates broken commit logs for > 3.0

patch by blambov; reviewed by jasobrown for CASSANDRA-11051


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/8f880151
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/8f880151
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/8f880151

Branch: refs/heads/trunk
Commit: 8f8801515def9eb74dbc220a67263f29189020a2
Parents: b1d063d
Author: blambov <br...@datastax.com>
Authored: Fri Jan 15 19:14:24 2016 -0800
Committer: Jason Brown <ja...@gmail.com>
Committed: Fri Jan 15 19:14:24 2016 -0800

----------------------------------------------------------------------
 CHANGES.txt                                           |  1 +
 .../cassandra/db/commitlog/CommitLogUpgradeTest.java  | 14 +++++++-------
 .../db/commitlog/CommitLogUpgradeTestMaker.java       |  5 ++++-
 3 files changed, 12 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/8f880151/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 33b9f9b..abfce95 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 3.4
+ * CommitLogUpgradeTestMaker creates broken commit logs (CASSANDRA-11051)
  * Add metric for number of dropped mutations (CASSANDRA-10866)
  * Simplify row cache invalidation code (CASSANDRA-10396)
  * Support user-defined compaction through nodetool (CASSANDRA-10660)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8f880151/test/unit/org/apache/cassandra/db/commitlog/CommitLogUpgradeTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/db/commitlog/CommitLogUpgradeTest.java b/test/unit/org/apache/cassandra/db/commitlog/CommitLogUpgradeTest.java
index 00a143b..8d412a1 100644
--- a/test/unit/org/apache/cassandra/db/commitlog/CommitLogUpgradeTest.java
+++ b/test/unit/org/apache/cassandra/db/commitlog/CommitLogUpgradeTest.java
@@ -65,6 +65,13 @@ public class CommitLogUpgradeTest
     private KillerForTests killerForTests;
     private boolean shouldBeKilled = false;
 
+    static CFMetaData metadata = CFMetaData.Builder.createDense(KEYSPACE, TABLE, false, false)
+                                                   .addPartitionKey("key", AsciiType.instance)
+                                                   .addClusteringColumn("col", AsciiType.instance)
+                                                   .addRegularColumn("val", BytesType.instance)
+                                                   .build()
+                                                   .compression(SchemaLoader.getCompressionParameters());
+
     @Before
     public void prepareToBeKilled()
     {
@@ -92,7 +99,6 @@ public class CommitLogUpgradeTest
     }
 
     @Test
-
     public void test22() throws Exception
     {
         testRestore(DATA_DIR + "2.2");
@@ -154,12 +160,6 @@ public class CommitLogUpgradeTest
     @BeforeClass
     static public void initialize() throws FileNotFoundException, IOException, InterruptedException
     {
-        CFMetaData metadata = CFMetaData.Builder.createDense(KEYSPACE, TABLE, false, false)
-                                                .addPartitionKey("key", AsciiType.instance)
-                                                .addClusteringColumn("col", AsciiType.instance)
-                                                .addRegularColumn("val", BytesType.instance)
-                                                .build()
-                                                .compression(SchemaLoader.getCompressionParameters());
         SchemaLoader.loadSchema();
         SchemaLoader.createKeyspace(KEYSPACE,
                                     KeyspaceParams.simple(1),

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8f880151/test/unit/org/apache/cassandra/db/commitlog/CommitLogUpgradeTestMaker.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/db/commitlog/CommitLogUpgradeTestMaker.java b/test/unit/org/apache/cassandra/db/commitlog/CommitLogUpgradeTestMaker.java
index dbdb7fc..80683c2 100644
--- a/test/unit/org/apache/cassandra/db/commitlog/CommitLogUpgradeTestMaker.java
+++ b/test/unit/org/apache/cassandra/db/commitlog/CommitLogUpgradeTestMaker.java
@@ -42,6 +42,7 @@ import org.apache.cassandra.config.Schema;
 import org.apache.cassandra.db.Mutation;
 import org.apache.cassandra.exceptions.ConfigurationException;
 import org.apache.cassandra.io.util.FileUtils;
+import org.apache.cassandra.schema.KeyspaceParams;
 import org.apache.cassandra.utils.FBUtilities;
 
 import static org.apache.cassandra.db.commitlog.CommitLogUpgradeTest.*;
@@ -91,7 +92,9 @@ public class CommitLogUpgradeTestMaker
         }
 
         SchemaLoader.loadSchema();
-        SchemaLoader.schemaDefinition("");
+        SchemaLoader.createKeyspace(KEYSPACE,
+                                    KeyspaceParams.simple(1),
+                                    metadata);
     }
 
     public void makeLog() throws IOException, InterruptedException