You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by be...@apache.org on 2015/05/07 12:26:04 UTC

[1/3] cassandra git commit: Improve sstable exclusion from partition tombstones

Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1 ce3ce44a5 -> b14236f94
  refs/heads/trunk 435827d15 -> ea2ee3703


Improve sstable exclusion from partition tombstones

patch by benedict; reviewed by aleksey for CASSANDRA-9298


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

Branch: refs/heads/cassandra-2.1
Commit: b14236f946337cab5f78407253bd296a6f3fbb22
Parents: ce3ce44
Author: Benedict Elliott Smith <be...@apache.org>
Authored: Thu May 7 11:24:50 2015 +0100
Committer: Benedict Elliott Smith <be...@apache.org>
Committed: Thu May 7 11:24:50 2015 +0100

----------------------------------------------------------------------
 CHANGES.txt                                             |  1 +
 .../org/apache/cassandra/db/CollationController.java    | 12 +++---------
 2 files changed, 4 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/b14236f9/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 09bdfb1..6363974 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.1.6
+ * Improve sstable exclusion from partition tombstones (CASSANDRA-9298)
  * Validate the indexed column rather than the cell's contents for 2i (CASSANDRA-9057)
  * Add support for top-k custom 2i queries (CASSANDRA-8717)
  * Fix error when dropping table during compaction (CASSANDRA-9251)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/b14236f9/src/java/org/apache/cassandra/db/CollationController.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/CollationController.java b/src/java/org/apache/cassandra/db/CollationController.java
index 4efcd9c..5c6a3db 100644
--- a/src/java/org/apache/cassandra/db/CollationController.java
+++ b/src/java/org/apache/cassandra/db/CollationController.java
@@ -77,11 +77,11 @@ public class CollationController
         boolean isEmpty = true;
         Tracing.trace("Acquiring sstable references");
         ColumnFamilyStore.ViewFragment view = cfs.select(cfs.viewFilter(filter.key));
+        DeletionInfo returnDeletionInfo = container.deletionInfo();
 
         try
         {
             Tracing.trace("Merging memtable contents");
-            long mostRecentRowTombstone = Long.MIN_VALUE;
             for (Memtable memtable : view.memtables)
             {
                 ColumnFamily cf = memtable.getColumnFamily(filter.key);
@@ -98,7 +98,6 @@ public class CollationController
                         container.addColumn(cell);
                     }
                 }
-                mostRecentRowTombstone = container.deletionInfo().getTopLevelDeletion().markedForDeleteAt;
             }
 
             // avoid changing the filter columns of the original filter
@@ -116,7 +115,7 @@ public class CollationController
                 // if we've already seen a row tombstone with a timestamp greater
                 // than the most recent update to this sstable, we're done, since the rest of the sstables
                 // will also be older
-                if (sstable.getMaxTimestamp() < mostRecentRowTombstone)
+                if (sstable.getMaxTimestamp() < returnDeletionInfo.getTopLevelDeletion().markedForDeleteAt)
                     break;
 
                 long currentMaxTs = sstable.getMaxTimestamp();
@@ -136,7 +135,6 @@ public class CollationController
                     while (iter.hasNext())
                         container.addAtom(iter.next());
                 }
-                mostRecentRowTombstone = container.deletionInfo().getTopLevelDeletion().markedForDeleteAt;
             }
 
             // we need to distinguish between "there is no data at all for this row" (BF will let us rebuild that efficiently)
@@ -244,7 +242,6 @@ public class CollationController
              */
             Collections.sort(view.sstables, SSTableReader.maxTimestampComparator);
             List<SSTableReader> skippedSSTables = null;
-            long mostRecentRowTombstone = Long.MIN_VALUE;
             long minTimestamp = Long.MAX_VALUE;
             int nonIntersectingSSTables = 0;
 
@@ -253,7 +250,7 @@ public class CollationController
                 minTimestamp = Math.min(minTimestamp, sstable.getMinTimestamp());
                 // if we've already seen a row tombstone with a timestamp greater
                 // than the most recent update to this sstable, we can skip it
-                if (sstable.getMaxTimestamp() < mostRecentRowTombstone)
+                if (sstable.getMaxTimestamp() < returnDeletionInfo.getTopLevelDeletion().markedForDeleteAt)
                     break;
 
                 if (!filter.shouldInclude(sstable))
@@ -275,9 +272,6 @@ public class CollationController
                 if (iter.getColumnFamily() != null)
                 {
                     ColumnFamily cf = iter.getColumnFamily();
-                    if (cf.isMarkedForDelete())
-                        mostRecentRowTombstone = cf.deletionInfo().getTopLevelDeletion().markedForDeleteAt;
-
                     returnCF.delete(cf);
                     sstablesIterated++;
                 }


[3/3] cassandra git commit: Merge branch 'cassandra-2.1' into trunk

Posted by be...@apache.org.
Merge branch 'cassandra-2.1' into trunk

Conflicts:
	CHANGES.txt


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

Branch: refs/heads/trunk
Commit: ea2ee3703c4f2804517e772fe38fa90780711540
Parents: 435827d b14236f9
Author: Benedict Elliott Smith <be...@apache.org>
Authored: Thu May 7 11:25:42 2015 +0100
Committer: Benedict Elliott Smith <be...@apache.org>
Committed: Thu May 7 11:25:42 2015 +0100

----------------------------------------------------------------------
 CHANGES.txt                                             |  3 ++-
 .../org/apache/cassandra/db/CollationController.java    | 12 +++---------
 2 files changed, 5 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/ea2ee370/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index dae32db,6363974..8cf9e6d
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,105 -1,6 +1,106 @@@
 +3.0
 + * Remove Thrift dependencies in bundled tools (CASSANDRA-8358)
 + * Disable memory mapping of hsperfdata file for JVM statistics (CASSANDRA-9242)
 + * Add pre-startup checks to detect potential incompatibilities (CASSANDRA-8049)
 + * Distinguish between null and unset in protocol v4 (CASSANDRA-7304)
 + * Add user/role permissions for user-defined functions (CASSANDRA-7557)
 + * Allow cassandra config to be updated to restart daemon without unloading classes (CASSANDRA-9046)
 + * Don't initialize compaction writer before checking if iter is empty (CASSANDRA-9117)
 + * Don't execute any functions at prepare-time (CASSANDRA-9037)
 + * Share file handles between all instances of a SegmentedFile (CASSANDRA-8893)
 + * Make it possible to major compact LCS (CASSANDRA-7272)
 + * Make FunctionExecutionException extend RequestExecutionException
 +   (CASSANDRA-9055)
 + * Add support for SELECT JSON, INSERT JSON syntax and new toJson(), fromJson()
 +   functions (CASSANDRA-7970)
 + * Optimise max purgeable timestamp calculation in compaction (CASSANDRA-8920)
 + * Constrain internode message buffer sizes, and improve IO class hierarchy (CASSANDRA-8670) 
 + * New tool added to validate all sstables in a node (CASSANDRA-5791)
 + * Push notification when tracing completes for an operation (CASSANDRA-7807)
 + * Delay "node up" and "node added" notifications until native protocol server is started (CASSANDRA-8236)
 + * Compressed Commit Log (CASSANDRA-6809)
 + * Optimise IntervalTree (CASSANDRA-8988)
 + * Add a key-value payload for third party usage (CASSANDRA-8553, 9212)
 + * Bump metrics-reporter-config dependency for metrics 3.0 (CASSANDRA-8149)
 + * Partition intra-cluster message streams by size, not type (CASSANDRA-8789)
 + * Add WriteFailureException to native protocol, notify coordinator of
 +   write failures (CASSANDRA-8592)
 + * Convert SequentialWriter to nio (CASSANDRA-8709)
 + * Add role based access control (CASSANDRA-7653, 8650, 7216, 8760, 8849, 8761, 8850)
 + * Record client ip address in tracing sessions (CASSANDRA-8162)
 + * Indicate partition key columns in response metadata for prepared
 +   statements (CASSANDRA-7660)
 + * Merge UUIDType and TimeUUIDType parse logic (CASSANDRA-8759)
 + * Avoid memory allocation when searching index summary (CASSANDRA-8793)
 + * Optimise (Time)?UUIDType Comparisons (CASSANDRA-8730)
 + * Make CRC32Ex into a separate maven dependency (CASSANDRA-8836)
 + * Use preloaded jemalloc w/ Unsafe (CASSANDRA-8714)
 + * Avoid accessing partitioner through StorageProxy (CASSANDRA-8244, 8268)
 + * Upgrade Metrics library and remove depricated metrics (CASSANDRA-5657)
 + * Serializing Row cache alternative, fully off heap (CASSANDRA-7438)
 + * Duplicate rows returned when in clause has repeated values (CASSANDRA-6707)
 + * Make CassandraException unchecked, extend RuntimeException (CASSANDRA-8560)
 + * Support direct buffer decompression for reads (CASSANDRA-8464)
 + * DirectByteBuffer compatible LZ4 methods (CASSANDRA-7039)
 + * Group sstables for anticompaction correctly (CASSANDRA-8578)
 + * Add ReadFailureException to native protocol, respond
 +   immediately when replicas encounter errors while handling
 +   a read request (CASSANDRA-7886)
 + * Switch CommitLogSegment from RandomAccessFile to nio (CASSANDRA-8308)
 + * Allow mixing token and partition key restrictions (CASSANDRA-7016)
 + * Support index key/value entries on map collections (CASSANDRA-8473)
 + * Modernize schema tables (CASSANDRA-8261)
 + * Support for user-defined aggregation functions (CASSANDRA-8053)
 + * Fix NPE in SelectStatement with empty IN values (CASSANDRA-8419)
 + * Refactor SelectStatement, return IN results in natural order instead
 +   of IN value list order and ignore duplicate values in partition key IN restrictions (CASSANDRA-7981)
 + * Support UDTs, tuples, and collections in user-defined
 +   functions (CASSANDRA-7563)
 + * Fix aggregate fn results on empty selection, result column name,
 +   and cqlsh parsing (CASSANDRA-8229)
 + * Mark sstables as repaired after full repair (CASSANDRA-7586)
 + * Extend Descriptor to include a format value and refactor reader/writer
 +   APIs (CASSANDRA-7443)
 + * Integrate JMH for microbenchmarks (CASSANDRA-8151)
 + * Keep sstable levels when bootstrapping (CASSANDRA-7460)
 + * Add Sigar library and perform basic OS settings check on startup (CASSANDRA-7838)
 + * Support for aggregation functions (CASSANDRA-4914)
 + * Remove cassandra-cli (CASSANDRA-7920)
 + * Accept dollar quoted strings in CQL (CASSANDRA-7769)
 + * Make assassinate a first class command (CASSANDRA-7935)
 + * Support IN clause on any partition key column (CASSANDRA-7855)
 + * Support IN clause on any clustering column (CASSANDRA-4762)
 + * Improve compaction logging (CASSANDRA-7818)
 + * Remove YamlFileNetworkTopologySnitch (CASSANDRA-7917)
 + * Do anticompaction in groups (CASSANDRA-6851)
 + * Support user-defined functions (CASSANDRA-7395, 7526, 7562, 7740, 7781, 7929,
 +   7924, 7812, 8063, 7813, 7708)
 + * Permit configurable timestamps with cassandra-stress (CASSANDRA-7416)
 + * Move sstable RandomAccessReader to nio2, which allows using the
 +   FILE_SHARE_DELETE flag on Windows (CASSANDRA-4050)
 + * Remove CQL2 (CASSANDRA-5918)
 + * Add Thrift get_multi_slice call (CASSANDRA-6757)
 + * Optimize fetching multiple cells by name (CASSANDRA-6933)
 + * Allow compilation in java 8 (CASSANDRA-7028)
 + * Make incremental repair default (CASSANDRA-7250)
 + * Enable code coverage thru JaCoCo (CASSANDRA-7226)
 + * Switch external naming of 'column families' to 'tables' (CASSANDRA-4369) 
 + * Shorten SSTable path (CASSANDRA-6962)
 + * Use unsafe mutations for most unit tests (CASSANDRA-6969)
 + * Fix race condition during calculation of pending ranges (CASSANDRA-7390)
 + * Fail on very large batch sizes (CASSANDRA-8011)
 + * Improve concurrency of repair (CASSANDRA-6455, 8208)
 + * Select optimal CRC32 implementation at runtime (CASSANDRA-8614)
 + * Evaluate MurmurHash of Token once per query (CASSANDRA-7096)
 + * Generalize progress reporting (CASSANDRA-8901)
 + * Resumable bootstrap streaming (CASSANDRA-8838, CASSANDRA-8942)
 + * Allow scrub for secondary index (CASSANDRA-5174)
 + * Save repair data to system table (CASSANDRA-5839)
 + * fix nodetool names that reference column families (CASSANDRA-8872)
 +
  2.1.6
-  * Validate the indexed column rather than the cell's contents. (CASSANDRA-9057)
+  * Improve sstable exclusion from partition tombstones (CASSANDRA-9298)
+  * Validate the indexed column rather than the cell's contents for 2i (CASSANDRA-9057)
   * Add support for top-k custom 2i queries (CASSANDRA-8717)
   * Fix error when dropping table during compaction (CASSANDRA-9251)
   * cassandra-stress supports validation operations over user profiles (CASSANDRA-8773)

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


[2/3] cassandra git commit: Improve sstable exclusion from partition tombstones

Posted by be...@apache.org.
Improve sstable exclusion from partition tombstones

patch by benedict; reviewed by aleksey for CASSANDRA-9298


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

Branch: refs/heads/trunk
Commit: b14236f946337cab5f78407253bd296a6f3fbb22
Parents: ce3ce44
Author: Benedict Elliott Smith <be...@apache.org>
Authored: Thu May 7 11:24:50 2015 +0100
Committer: Benedict Elliott Smith <be...@apache.org>
Committed: Thu May 7 11:24:50 2015 +0100

----------------------------------------------------------------------
 CHANGES.txt                                             |  1 +
 .../org/apache/cassandra/db/CollationController.java    | 12 +++---------
 2 files changed, 4 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/b14236f9/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 09bdfb1..6363974 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.1.6
+ * Improve sstable exclusion from partition tombstones (CASSANDRA-9298)
  * Validate the indexed column rather than the cell's contents for 2i (CASSANDRA-9057)
  * Add support for top-k custom 2i queries (CASSANDRA-8717)
  * Fix error when dropping table during compaction (CASSANDRA-9251)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/b14236f9/src/java/org/apache/cassandra/db/CollationController.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/CollationController.java b/src/java/org/apache/cassandra/db/CollationController.java
index 4efcd9c..5c6a3db 100644
--- a/src/java/org/apache/cassandra/db/CollationController.java
+++ b/src/java/org/apache/cassandra/db/CollationController.java
@@ -77,11 +77,11 @@ public class CollationController
         boolean isEmpty = true;
         Tracing.trace("Acquiring sstable references");
         ColumnFamilyStore.ViewFragment view = cfs.select(cfs.viewFilter(filter.key));
+        DeletionInfo returnDeletionInfo = container.deletionInfo();
 
         try
         {
             Tracing.trace("Merging memtable contents");
-            long mostRecentRowTombstone = Long.MIN_VALUE;
             for (Memtable memtable : view.memtables)
             {
                 ColumnFamily cf = memtable.getColumnFamily(filter.key);
@@ -98,7 +98,6 @@ public class CollationController
                         container.addColumn(cell);
                     }
                 }
-                mostRecentRowTombstone = container.deletionInfo().getTopLevelDeletion().markedForDeleteAt;
             }
 
             // avoid changing the filter columns of the original filter
@@ -116,7 +115,7 @@ public class CollationController
                 // if we've already seen a row tombstone with a timestamp greater
                 // than the most recent update to this sstable, we're done, since the rest of the sstables
                 // will also be older
-                if (sstable.getMaxTimestamp() < mostRecentRowTombstone)
+                if (sstable.getMaxTimestamp() < returnDeletionInfo.getTopLevelDeletion().markedForDeleteAt)
                     break;
 
                 long currentMaxTs = sstable.getMaxTimestamp();
@@ -136,7 +135,6 @@ public class CollationController
                     while (iter.hasNext())
                         container.addAtom(iter.next());
                 }
-                mostRecentRowTombstone = container.deletionInfo().getTopLevelDeletion().markedForDeleteAt;
             }
 
             // we need to distinguish between "there is no data at all for this row" (BF will let us rebuild that efficiently)
@@ -244,7 +242,6 @@ public class CollationController
              */
             Collections.sort(view.sstables, SSTableReader.maxTimestampComparator);
             List<SSTableReader> skippedSSTables = null;
-            long mostRecentRowTombstone = Long.MIN_VALUE;
             long minTimestamp = Long.MAX_VALUE;
             int nonIntersectingSSTables = 0;
 
@@ -253,7 +250,7 @@ public class CollationController
                 minTimestamp = Math.min(minTimestamp, sstable.getMinTimestamp());
                 // if we've already seen a row tombstone with a timestamp greater
                 // than the most recent update to this sstable, we can skip it
-                if (sstable.getMaxTimestamp() < mostRecentRowTombstone)
+                if (sstable.getMaxTimestamp() < returnDeletionInfo.getTopLevelDeletion().markedForDeleteAt)
                     break;
 
                 if (!filter.shouldInclude(sstable))
@@ -275,9 +272,6 @@ public class CollationController
                 if (iter.getColumnFamily() != null)
                 {
                     ColumnFamily cf = iter.getColumnFamily();
-                    if (cf.isMarkedForDelete())
-                        mostRecentRowTombstone = cf.deletionInfo().getTopLevelDeletion().markedForDeleteAt;
-
                     returnCF.delete(cf);
                     sstablesIterated++;
                 }