cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yu...@apache.org
Subject [01/10] git commit: Fix LCS L0 compaction may overlap in L1
Date Wed, 21 Aug 2013 20:36:42 GMT
Updated Branches:
  refs/heads/cassandra-1.2 572cddc30 -> ad8f88e21
  refs/heads/cassandra-2.0 9e2961964 -> d6e0ca043
  refs/heads/cassandra-2.0.0 9dc4c16d7 -> 7d3eef823
  refs/heads/trunk 487e3de05 -> c43a59ccc


Fix LCS L0 compaction may overlap in L1

patch by yukim; reviewed by jbellis for CASSANDRA-5907


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

Branch: refs/heads/cassandra-1.2
Commit: ad8f88e21213982e3eb5137723a3885726a567e8
Parents: 572cddc
Author: Yuki Morishita <yukim@apache.org>
Authored: Wed Aug 21 15:30:16 2013 -0500
Committer: Yuki Morishita <yukim@apache.org>
Committed: Wed Aug 21 15:30:16 2013 -0500

----------------------------------------------------------------------
 CHANGES.txt                                             |  1 +
 .../apache/cassandra/db/compaction/LeveledManifest.java | 12 ++++++------
 2 files changed, 7 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/ad8f88e2/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 1ffec7d..e1c963c 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -25,6 +25,7 @@
  * Add -no-snapshot option to scrub (CASSANDRA-5891)
  * Fix to support off heap bloom filters size greater than 2 GB (CASSANDRA-5903)
  * Properly handle parsing huge map and set literals (CASSANDRA-5893)
+ * Fix LCS L0 compaction may overlap in L1 (CASSANDRA-5907)
 Merged from 1.1:
  * Correctly validate sparse composite cells in scrub (CASSANDRA-5855)
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/ad8f88e2/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 f62c796..fc10883 100644
--- a/src/java/org/apache/cassandra/db/compaction/LeveledManifest.java
+++ b/src/java/org/apache/cassandra/db/compaction/LeveledManifest.java
@@ -530,13 +530,13 @@ public class LeveledManifest
                 // if the overlapping ones are already busy in a compaction, leave it out.
                 // TODO try to find a set of L0 sstables that only overlaps with non-busy
L1 sstables
                 candidates = Sets.union(candidates, overlapping(candidates, generations[1]));
-                // check overlap with L0 compacting sstables to make sure we are not generating
overlap in L1.
-                Iterable<SSTableReader> compactingL0 = Iterables.filter(generations[0],
Predicates.in(compacting));
-                if (!Sets.intersection(candidates, compacting).isEmpty() || !overlapping(candidates,
compactingL0).isEmpty())
-                    return Collections.emptyList();
             }
-
-            return candidates.size() > 1 ? candidates : Collections.<SSTableReader>emptyList();
+            // check overlap with L0 compacting sstables to make sure we are not generating
overlap in L1.
+            Iterable<SSTableReader> compactingL0 = Iterables.filter(generations[0],
Predicates.in(compacting));
+            if (candidates.size() < 2 || !Sets.intersection(candidates, compacting).isEmpty()
|| !overlapping(candidates, compactingL0).isEmpty())
+                return Collections.emptyList();
+            else
+                return candidates;
         }
 
         // for non-L0 compactions, pick up where we left off last time


Mime
View raw message