You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by sl...@apache.org on 2014/01/31 22:11:10 UTC
[1/2] git commit: unify test timeouts, exclude pig
Updated Branches:
refs/heads/trunk 016a2b052 -> 944c01517
unify test timeouts, exclude pig
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/944c0151
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/944c0151
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/944c0151
Branch: refs/heads/trunk
Commit: 944c015175c3234bd7bbf1ee9900db8a0d0e7064
Parents: 3d64d3a
Author: Brandon Williams <br...@apache.org>
Authored: Fri Jan 31 12:20:18 2014 -0600
Committer: Sylvain Lebresne <sy...@datastax.com>
Committed: Fri Jan 31 22:11:01 2014 +0100
----------------------------------------------------------------------
build.xml | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/944c0151/build.xml
----------------------------------------------------------------------
diff --git a/build.xml b/build.xml
index a033874..032cc71 100644
--- a/build.xml
+++ b/build.xml
@@ -1109,17 +1109,20 @@
</target>
<target name="test" depends="build-test" description="Execute unit tests">
- <testmacro suitename="unit" inputdir="${test.unit.src}" timeout="60000">
+ <testmacro suitename="unit" inputdir="${test.unit.src}" timeout="${test.timeout}">
<jvmarg value="-Dlegacy-sstable-root=${test.data}/legacy-sstables"/>
<jvmarg value="-Dcorrupt-sstable-root=${test.data}/corrupt-sstables"/>
<jvmarg value="-Dmigration-sstable-root=${test.data}/migration-sstables"/>
<jvmarg value="-Dcassandra.ring_delay_ms=1000"/>
<jvmarg value="-Dcassandra.tolerate_sstable_size=true"/>
</testmacro>
+ <fileset dir="${test.unit.src}">
+ <exclude name="**/pig/*.java" />
+ </fileset>
</target>
<target name="test-compression" depends="build-test" description="Execute unit tests with sstable compression enabled">
- <testmacro suitename="unit" inputdir="${test.unit.src}" timeout="60000">
+ <testmacro suitename="unit" inputdir="${test.unit.src}" timeout="${test.timeout}">
<jvmarg value="-Dlegacy-sstable-root=${test.data}/legacy-sstables"/>
<jvmarg value="-Dcorrupt-sstable-root=${test.data}/corrupt-sstables"/>
<jvmarg value="-Dmigration-sstable-root=${test.data}/migration-sstables"/>
@@ -1127,30 +1130,33 @@
<jvmarg value="-Dcassandra.ring_delay_ms=1000"/>
<jvmarg value="-Dcassandra.tolerate_sstable_size=true"/>
</testmacro>
+ <fileset dir="${test.unit.src}">
+ <exclude name="**/pig/*.java" />
+ </fileset>
</target>
<target name="msg-ser-gen-test" depends="build-test" description="Generates message serializations">
<testmacro suitename="unit" inputdir="${test.unit.src}"
- timeout="60000" filter="**/SerializationsTest.java">
+ timeout="${test.timeout}" filter="**/SerializationsTest.java">
<jvmarg value="-Dcassandra.test-serialization-writes=True"/>
</testmacro>
</target>
<target name="msg-ser-test" depends="build-test" description="Tests message serializations">
- <testmacro suitename="unit" inputdir="${test.unit.src}" timeout="60000"
+ <testmacro suitename="unit" inputdir="${test.unit.src}" timeout="${test.timeout}"
filter="**/SerializationsTest.java"/>
</target>
<target name="msg-ser-test-7" depends="build-test" description="Generates message serializations">
<testmacro suitename="unit" inputdir="${test.unit.src}"
- timeout="60000" filter="**/SerializationsTest.java">
+ timeout="${test.timeout}" filter="**/SerializationsTest.java">
<jvmarg value="-Dcassandra.version=0.7"/>
</testmacro>
</target>
<target name="msg-ser-test-10" depends="build-test" description="Tests message serializations on 1.0 messages">
<testmacro suitename="unit" inputdir="${test.unit.src}"
- timeout="60000" filter="**/SerializationsTest.java">
+ timeout="${test.timeout}" filter="**/SerializationsTest.java">
<jvmarg value="-Dcassandra.version=1.0"/>
</testmacro>
</target>
[2/2] git commit: Fix potential loss of 2ndary index entry during
compaction
Posted by sl...@apache.org.
Fix potential loss of 2ndary index entry during compaction
patch by slebresne; reviewed by beobal for CASSANDRA-6517
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/3d64d3ad
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/3d64d3ad
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/3d64d3ad
Branch: refs/heads/trunk
Commit: 3d64d3ad2793a86c8b162ee6a5be0698ac0d2d52
Parents: 016a2b0
Author: Sylvain Lebresne <sy...@datastax.com>
Authored: Fri Jan 31 16:47:01 2014 +0100
Committer: Sylvain Lebresne <sy...@datastax.com>
Committed: Fri Jan 31 22:11:01 2014 +0100
----------------------------------------------------------------------
CHANGES.txt | 1 +
.../apache/cassandra/db/RangeTombstoneTest.java | 54 ++++++++++++++++++++
2 files changed, 55 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/3d64d3ad/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 7f23a3f..6ca163a 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -48,6 +48,7 @@
* sstables from stalled repair sessions can resurrect deleted data (CASSANDRA-6503)
* Switch stress to use ITransportFactory (CASSANDRA-6641)
* Fix IllegalArgumentException during prepare (CASSANDRA-6592)
+ * Fix possible loss of 2ndary index entries during compaction (CASSANDRA-6517)
Merged from 1.2:
* fsync compression metadata (CASSANDRA-6531)
* Validate CF existence on execution for prepared statement (CASSANDRA-6535)
http://git-wip-us.apache.org/repos/asf/cassandra/blob/3d64d3ad/test/unit/org/apache/cassandra/db/RangeTombstoneTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/db/RangeTombstoneTest.java b/test/unit/org/apache/cassandra/db/RangeTombstoneTest.java
index 74bc098..b859023 100644
--- a/test/unit/org/apache/cassandra/db/RangeTombstoneTest.java
+++ b/test/unit/org/apache/cassandra/db/RangeTombstoneTest.java
@@ -37,6 +37,7 @@ import org.apache.cassandra.db.compaction.CompactionManager;
import org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy;
import org.apache.cassandra.db.filter.*;
import org.apache.cassandra.db.index.*;
+import org.apache.cassandra.db.marshal.Int32Type;
import org.apache.cassandra.exceptions.ConfigurationException;
import org.apache.cassandra.io.sstable.SSTableReader;
import org.apache.cassandra.utils.ByteBufferUtil;
@@ -302,6 +303,59 @@ public class RangeTombstoneTest extends SchemaLoader
assertEquals(index.deletes.get(0), index.inserts.get(0));
}
+ @Test
+ public void testOverwritesToDeletedColumns() throws Exception
+ {
+ Keyspace table = Keyspace.open(KSNAME);
+ ColumnFamilyStore cfs = table.getColumnFamilyStore(CFNAME);
+ ByteBuffer key = ByteBufferUtil.bytes("k6");
+ ByteBuffer indexedColumnName = ByteBufferUtil.bytes(1);
+
+ cfs.truncateBlocking();
+ cfs.disableAutoCompaction();
+ cfs.setCompactionStrategyClass(SizeTieredCompactionStrategy.class.getCanonicalName());
+ if (cfs.indexManager.getIndexForColumn(indexedColumnName) == null)
+ {
+ ColumnDefinition cd = new ColumnDefinition(cfs.metadata, indexedColumnName, Int32Type.instance, null, ColumnDefinition.Kind.REGULAR);
+ cd.setIndex("test_index", IndexType.CUSTOM, ImmutableMap.of(SecondaryIndex.CUSTOM_INDEX_OPTION_NAME, TestIndex.class.getName()));
+ cfs.indexManager.addIndexedColumn(cd);
+ }
+
+ TestIndex index = ((TestIndex)cfs.indexManager.getIndexForColumn(indexedColumnName));
+ index.resetCounts();
+
+ Mutation rm = new Mutation(KSNAME, key);
+ add(rm, 1, 0);
+ rm.apply();
+
+ // add a RT which hides the column we just inserted
+ rm = new Mutation(KSNAME, key);
+ ColumnFamily cf = rm.addOrGet(CFNAME);
+ delete(cf, 0, 1, 1);
+ rm.apply();
+
+ // now re-insert that column
+ rm = new Mutation(KSNAME, key);
+ add(rm, 1, 2);
+ rm.apply();
+
+ cfs.forceBlockingFlush();
+
+ // We should have 2 updates to the indexed "1" column
+ assertEquals(2, index.inserts.size());
+
+ CompactionManager.instance.performMaximal(cfs);
+
+ // verify that the "1" indexed column removed from the index twice:
+ // the first time by processing the RT, the second time by the
+ // re-indexing caused by the second insertion. This second write
+ // deletes from the 2i because the original column was still in the
+ // main cf's memtable (shadowed by the RT). One thing we're checking
+ // for here is that there wasn't an additional, bogus delete issued
+ // to the 2i (CASSANDRA-6517)
+ assertEquals(2, index.deletes.size());
+ }
+
private void runCompactionWithRangeTombstoneAndCheckSecondaryIndex() throws Exception
{
Keyspace table = Keyspace.open(KSNAME);