cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jji...@apache.org
Subject [4/6] cassandra git commit: Merge branch 'cassandra-3.0' into cassandra-3.11
Date Tue, 12 Dec 2017 17:59:37 GMT
Merge branch 'cassandra-3.0' into cassandra-3.11


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

Branch: refs/heads/trunk
Commit: 052514542220e66e8b755aaf8b5e015c8416b5a1
Parents: a7c45be 4a2b516
Author: Jeff Jirsa <jjirsa@apple.com>
Authored: Tue Dec 12 09:52:50 2017 -0800
Committer: Jeff Jirsa <jjirsa@apple.com>
Committed: Tue Dec 12 09:55:39 2017 -0800

----------------------------------------------------------------------
 CHANGES.txt                                     |   1 +
 .../org/apache/cassandra/db/LegacyLayout.java   | 103 ++++++++++++-------
 ...egacy_ka_repeated_rt-ka-1-CompressionInfo.db | Bin 0 -> 43 bytes
 ...Keyspace1-legacy_ka_repeated_rt-ka-1-Data.db | Bin 0 -> 422 bytes
 ...pace1-legacy_ka_repeated_rt-ka-1-Digest.sha1 |   1 +
 ...yspace1-legacy_ka_repeated_rt-ka-1-Filter.db | Bin 0 -> 176 bytes
 ...eyspace1-legacy_ka_repeated_rt-ka-1-Index.db | Bin 0 -> 570 bytes
 ...ce1-legacy_ka_repeated_rt-ka-1-Statistics.db | Bin 0 -> 4478 bytes
 ...space1-legacy_ka_repeated_rt-ka-1-Summary.db | Bin 0 -> 92 bytes
 ...Keyspace1-legacy_ka_repeated_rt-ka-1-TOC.txt |   8 ++
 .../apache/cassandra/db/LegacyLayoutTest.java   | 100 ++++++++++++++++++
 11 files changed, 176 insertions(+), 37 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/05251454/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index 116c7e9,1ca7902..da40341
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,14 -1,5 +1,15 @@@
 -3.0.16
 +3.11.2
 + * Fix imbalanced disks when replacing node with same address with JBOD (CASSANDRA-14084)
 + * Reload compaction strategies when disk boundaries are invalidated (CASSANDRA-13948)
 + * Remove OpenJDK log warning (CASSANDRA-13916)
 + * Prevent compaction strategies from looping indefinitely (CASSANDRA-14079)
 + * Cache disk boundaries (CASSANDRA-13215)
 + * Add asm jar to build.xml for maven builds (CASSANDRA-11193)
 + * Round buffer size to powers of 2 for the chunk cache (CASSANDRA-13897)
 + * Update jackson JSON jars (CASSANDRA-13949)
 + * Avoid locks when checking LCS fanout and if we should defrag (CASSANDRA-13930)
 +Merged from 3.0:
+  * Extra range tombstone bound creates double rows (CASSANDRA-14008)
   * Fix SStable ordering by max timestamp in SinglePartitionReadCommand (CASSANDRA-14010)
   * Accept role names containing forward-slash (CASSANDRA-14088)
   * Optimize CRC check chance probability calculations (CASSANDRA-14094)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/05251454/src/java/org/apache/cassandra/db/LegacyLayout.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/05251454/test/unit/org/apache/cassandra/db/LegacyLayoutTest.java
----------------------------------------------------------------------
diff --cc test/unit/org/apache/cassandra/db/LegacyLayoutTest.java
index 6103727,715d7c9..be695f2
--- a/test/unit/org/apache/cassandra/db/LegacyLayoutTest.java
+++ b/test/unit/org/apache/cassandra/db/LegacyLayoutTest.java
@@@ -19,12 -19,19 +19,22 @@@
  package org.apache.cassandra.db;
  
  import java.nio.ByteBuffer;
+ import java.nio.file.Files;
+ import java.nio.file.Path;
+ import java.nio.file.Paths;
  
++import org.junit.AfterClass;
++import org.junit.BeforeClass;
  import org.junit.Test;
  
+ import org.apache.cassandra.SchemaLoader;
++import org.apache.cassandra.Util;
  import org.apache.cassandra.config.CFMetaData;
  import org.apache.cassandra.config.ColumnDefinition;
+ import org.apache.cassandra.config.DatabaseDescriptor;
  import org.apache.cassandra.cql3.ColumnIdentifier;
+ import org.apache.cassandra.cql3.QueryProcessor;
+ import org.apache.cassandra.cql3.UntypedResultSet;
  import org.apache.cassandra.db.marshal.Int32Type;
  import org.apache.cassandra.db.marshal.SetType;
  import org.apache.cassandra.db.partitions.PartitionUpdate;
@@@ -37,6 -45,6 +48,24 @@@ import static org.junit.Assert.*
  
  public class LegacyLayoutTest
  {
++    static Util.PartitionerSwitcher sw;
++    static String KEYSPACE = "Keyspace1";
++
++    @BeforeClass
++    public static void setupPartitioner()
++    {
++        DatabaseDescriptor.daemonInitialization();
++        sw = Util.switchPartitioner(Murmur3Partitioner.instance);
++        SchemaLoader.loadSchema();
++        SchemaLoader.createKeyspace(KEYSPACE, KeyspaceParams.simple(1));
++    }
++
++    @AfterClass
++    public static void resetPartitioner()
++    {
++        sw.close();
++    }
++
      @Test
      public void testFromUnfilteredRowIterator() throws Throwable
      {
@@@ -70,4 -77,78 +99,75 @@@
          assertEquals("b", l.starts[1].collectionName.name.toString());
          assertEquals("b", l.ends[1].collectionName.name.toString());
      }
+ 
+     /**
+      * Tests with valid sstables containing duplicate RT entries at index boundaries
+      * in 2.1 format, where DATA below is a > 1000 byte long string of letters,
+      * and the column index is set to 1kb
+ 
+      [
+      {"key": "1",
+      "cells": [["1:_","1:!",1513015245,"t",1513015263],
+      ["1:1:","",1513015467727335],
+      ["1:1:val1","DATA",1513015467727335],
+      ["1:_","1:!",1513015245,"t",1513015263],
+      ["1:1:val2","DATA",1513015467727335],
+      ["1:_","1:!",1513015245,"t",1513015263],
+      ["1:1:val3","DATA",1513015467727335],
+      ["1:_","1:!",1513015245,"t",1513015263],
+      ["1:2:","",1513015458470156],
+      ["1:2:val1","DATA",1513015458470156],
+      ["1:_","1:!",1513015245,"t",1513015263],
+      ["1:2:val2","DATA",1513015458470156],
+      ["1:_","1:!",1513015245,"t",1513015263],
+      ["1:2:val3","DATA",1513015458470156],
+      ["1:_","1:!",1513015245,"t",1513015263],
+      ["1:3:","",1513015450253602],
+      ["1:3:val1","DATA",1513015450253602],
+      ["1:_","1:!",1513015245,"t",1513015263],
+      ["1:3:val2","DATA",1513015450253602],
+      ["1:_","1:!",1513015245,"t",1513015263],
+      ["1:3:val3","DATA",1513015450253602]]}
+      ]
+      *
+      * See CASSANDRA-14008 for details.
+      */
+     @Test
+     public void testRTBetweenColumns() throws Throwable
+     {
 -        String KEYSPACE = "Keyspace1";
 -        DatabaseDescriptor.setPartitionerUnsafe(Murmur3Partitioner.instance);
+ 
 -        SchemaLoader.loadSchema();
 -        SchemaLoader.createKeyspace(KEYSPACE, KeyspaceParams.simple(1));
+         QueryProcessor.executeInternal(String.format("CREATE TABLE \"%s\".legacy_ka_repeated_rt
(k1 int, c1 int, c2 int, val1 text, val2 text, val3 text, primary key (k1, c1, c2))", KEYSPACE));
+ 
+         Keyspace keyspace = Keyspace.open(KEYSPACE);
+         ColumnFamilyStore cfs = keyspace.getColumnFamilyStore("legacy_ka_repeated_rt");
+ 
+         Path legacySSTableRoot = Paths.get("test/data/legacy-sstables/ka/legacy_tables/legacy_ka_repeated_rt/");
+ 
+         for (String filename : new String[]{ "Keyspace1-legacy_ka_repeated_rt-ka-1-CompressionInfo.db",
+                                              "Keyspace1-legacy_ka_repeated_rt-ka-1-Data.db",
+                                              "Keyspace1-legacy_ka_repeated_rt-ka-1-Digest.sha1",
+                                              "Keyspace1-legacy_ka_repeated_rt-ka-1-Filter.db",
+                                              "Keyspace1-legacy_ka_repeated_rt-ka-1-Index.db",
+                                              "Keyspace1-legacy_ka_repeated_rt-ka-1-Statistics.db",
+                                              "Keyspace1-legacy_ka_repeated_rt-ka-1-Summary.db",
+                                              "Keyspace1-legacy_ka_repeated_rt-ka-1-TOC.txt"
})
+         {
+             Files.copy(Paths.get(legacySSTableRoot.toString(), filename), cfs.getDirectories().getDirectoryForNewSSTables().toPath().resolve(filename));
+         }
+ 
+         cfs.loadNewSSTables();
+ 
+         UntypedResultSet rs = QueryProcessor.executeInternal(String.format("SELECT * FROM
\"%s\".legacy_ka_repeated_rt WHERE k1=1", KEYSPACE));
+         assertEquals(3, rs.size());
++
+         UntypedResultSet rs2 = QueryProcessor.executeInternal(String.format("SELECT * FROM
\"%s\".legacy_ka_repeated_rt WHERE k1=1 AND c1=1", KEYSPACE));
+         assertEquals(3, rs2.size());
++
+         for (int i = 1; i <= 3; i++)
+         {
+             UntypedResultSet rs3 = QueryProcessor.executeInternal(String.format("SELECT
* FROM \"%s\".legacy_ka_repeated_rt WHERE k1=1 AND c1=1 AND c2=%s", KEYSPACE, i));
+             assertEquals(1, rs3.size());
 -
+         }
+ 
+     }
  }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org


Mime
View raw message