You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by ma...@apache.org on 2014/11/07 13:45:26 UTC

[1/2] cassandra git commit: Avoid overlap in L1 when L0 contains many non-overlapping sstables

Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1 ffe69c3d7 -> cb9d3881f


Avoid overlap in L1 when L0 contains many non-overlapping sstables

Patch by marcuse; reviewed by yukim for CASSANDRA-8211


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

Branch: refs/heads/cassandra-2.1
Commit: 486885493471b5f20d86287d3fe03bc99a983fb1
Parents: 6b3f3e9
Author: Marcus Eriksson <ma...@apache.org>
Authored: Tue Nov 4 11:39:29 2014 +0100
Committer: Marcus Eriksson <ma...@apache.org>
Committed: Fri Nov 7 13:42:06 2014 +0100

----------------------------------------------------------------------
 CHANGES.txt                                           |  2 ++
 .../cassandra/db/compaction/LeveledManifest.java      | 14 +++++++++++---
 2 files changed, 13 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/48688549/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 8a7697b..2b3bd3c 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,6 @@
 2.0.12:
+ * Avoid overlap in L1 when L0 contains many nonoverlapping
+   sstables (CASSANDRA-8211)
  * Improve PropertyFileSnitch logging (CASSANDRA-8183)
  * Abort liveRatio calculation if the memtable is flushed (CASSANDRA-8164)
  * Correctly handle non-text column names in cql3 (CASSANDRA-8178)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/48688549/src/java/org/apache/cassandra/db/compaction/LeveledManifest.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/compaction/LeveledManifest.java b/src/java/org/apache/cassandra/db/compaction/LeveledManifest.java
index b704523..aefd573 100644
--- a/src/java/org/apache/cassandra/db/compaction/LeveledManifest.java
+++ b/src/java/org/apache/cassandra/db/compaction/LeveledManifest.java
@@ -486,6 +486,16 @@ public class LeveledManifest
         {
             Set<SSTableReader> compactingL0 = ImmutableSet.copyOf(Iterables.filter(generations[0], Predicates.in(compacting)));
 
+            RowPosition lastCompactingKey = null;
+            RowPosition firstCompactingKey = null;
+            for (SSTableReader candidate : compactingL0)
+            {
+                if (firstCompactingKey == null || candidate.first.compareTo(firstCompactingKey) < 0)
+                    firstCompactingKey = candidate.first;
+                if (lastCompactingKey == null || candidate.last.compareTo(lastCompactingKey) > 0)
+                    lastCompactingKey = candidate.last;
+            }
+
             // L0 is the dumping ground for new sstables which thus may overlap each other.
             //
             // We treat L0 compactions specially:
@@ -513,9 +523,7 @@ public class LeveledManifest
 
                 for (SSTableReader newCandidate : overlappedL0)
                 {
-                    // overlappedL0 could contain sstables that are not in compactingL0, but do overlap
-                    // other sstables that are
-                    if (overlapping(newCandidate, compactingL0).isEmpty())
+                    if (firstCompactingKey == null || lastCompactingKey == null || overlapping(firstCompactingKey.getToken(), lastCompactingKey.getToken(), Arrays.asList(newCandidate)).size() == 0)
                         candidates.add(newCandidate);
                     remaining.remove(newCandidate);
                 }


[2/2] cassandra git commit: Merge branch 'cassandra-2.0' into cassandra-2.1

Posted by ma...@apache.org.
Merge branch 'cassandra-2.0' into cassandra-2.1

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/cb9d3881
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/cb9d3881
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/cb9d3881

Branch: refs/heads/cassandra-2.1
Commit: cb9d3881fc00fdfb225757d9d64c96d689817dec
Parents: ffe69c3 4868854
Author: Marcus Eriksson <ma...@apache.org>
Authored: Fri Nov 7 13:44:09 2014 +0100
Committer: Marcus Eriksson <ma...@apache.org>
Committed: Fri Nov 7 13:44:09 2014 +0100

----------------------------------------------------------------------
 CHANGES.txt                                           |  2 ++
 .../cassandra/db/compaction/LeveledManifest.java      | 14 +++++++++++---
 2 files changed, 13 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/cb9d3881/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index c1cc083,2b3bd3c..d868a2c
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,35 -1,8 +1,37 @@@
 -2.0.12:
 +2.1.3
 + * Fix overflow on histogram computation (CASSANDRA-8028)
 + * Have paxos reuse the timestamp generation of normal queries (CASSANDRA-7801)
 +Merged from 2.0:
+  * Avoid overlap in L1 when L0 contains many nonoverlapping
+    sstables (CASSANDRA-8211)
   * Improve PropertyFileSnitch logging (CASSANDRA-8183)
 - * Abort liveRatio calculation if the memtable is flushed (CASSANDRA-8164)
 +
 +2.1.2
 + * (cqlsh) parse_for_table_meta errors out on queries with undefined
 +   grammars (CASSANDRA-8262)
 + * (cqlsh) Fix SELECT ... TOKEN() function broken in C* 2.1.1 (CASSANDRA-8258)
 + * Fix Cassandra crash when running on JDK8 update 40 (CASSANDRA-8209)
 + * Optimize partitioner tokens (CASSANDRA-8230)
 + * Improve compaction of repaired/unrepaired sstables (CASSANDRA-8004)
 + * Make cache serializers pluggable (CASSANDRA-8096)
 + * Fix issues with CONTAINS (KEY) queries on secondary indexes
 +   (CASSANDRA-8147)
 + * Fix read-rate tracking of sstables for some queries (CASSANDRA-8239)
 + * Fix default timestamp in QueryOptions (CASSANDRA-8246)
 + * Set socket timeout when reading remote version (CASSANDRA-8188)
 + * Refactor how we track live size (CASSANDRA-7852)
 + * Make sure unfinished compaction files are removed (CASSANDRA-8124)
 + * Fix shutdown when run as Windows service (CASSANDRA-8136)
 + * Fix DESCRIBE TABLE with custom indexes (CASSANDRA-8031)
 + * Fix race in RecoveryManagerTest (CASSANDRA-8176)
 + * Avoid IllegalArgumentException while sorting sstables in
 +   IndexSummaryManager (CASSANDRA-8182)
 + * Shutdown JVM on file descriptor exhaustion (CASSANDRA-7579)
 + * Add 'die' policy for commit log and disk failure (CASSANDRA-7927)
 + * Fix installing as service on Windows (CASSANDRA-8115)
 + * Fix CREATE TABLE for CQL2 (CASSANDRA-8144)
 + * Avoid boxing in ColumnStats min/max trackers (CASSANDRA-8109)
 +Merged from 2.0:
   * Correctly handle non-text column names in cql3 (CASSANDRA-8178)
   * Fix deletion for indexes on primary key columns (CASSANDRA-8206)
   * Add 'nodetool statusgossip' (CASSANDRA-8125)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cb9d3881/src/java/org/apache/cassandra/db/compaction/LeveledManifest.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/db/compaction/LeveledManifest.java
index 4b26d23,aefd573..f2af848
--- a/src/java/org/apache/cassandra/db/compaction/LeveledManifest.java
+++ b/src/java/org/apache/cassandra/db/compaction/LeveledManifest.java
@@@ -534,8 -484,18 +534,18 @@@ public class LeveledManifes
  
          if (level == 0)
          {
 -            Set<SSTableReader> compactingL0 = ImmutableSet.copyOf(Iterables.filter(generations[0], Predicates.in(compacting)));
 +            Set<SSTableReader> compactingL0 = ImmutableSet.copyOf(Iterables.filter(getLevel(0), Predicates.in(compacting)));
  
+             RowPosition lastCompactingKey = null;
+             RowPosition firstCompactingKey = null;
+             for (SSTableReader candidate : compactingL0)
+             {
+                 if (firstCompactingKey == null || candidate.first.compareTo(firstCompactingKey) < 0)
+                     firstCompactingKey = candidate.first;
+                 if (lastCompactingKey == null || candidate.last.compareTo(lastCompactingKey) > 0)
+                     lastCompactingKey = candidate.last;
+             }
+ 
              // L0 is the dumping ground for new sstables which thus may overlap each other.
              //
              // We treat L0 compactions specially: