Fix test setup and repair/LCS edge case for CASSANDRA-4799

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

Branch: refs/heads/cassandra-1.1
Commit: e1491f3f24ef0a1898dfa598956d6781f55d0957
Parents: 4d2e5e7
Author: Yuki Morishita <yu...@apache.org>
Authored: Tue Oct 16 09:36:51 2012 -0500
Committer: Yuki Morishita <yu...@apache.org>
Committed: Tue Oct 16 09:36:51 2012 -0500

----------------------------------------------------------------------
 .../db/compaction/LeveledCompactionStrategy.java   |    4 +++-
 .../compaction/LeveledCompactionStrategyTest.java  |    2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/e1491f3f/src/java/org/apache/cassandra/db/compaction/LeveledCompactionStrategy.java
----------------------------------------------------------------------
diff --git 
a/src/java/org/apache/cassandra/db/compaction/LeveledCompactionStrategy.java 
b/src/java/org/apache/cassandra/db/compaction/LeveledCompactionStrategy.java
index d14545c..9fb6a89 100644
--- a/src/java/org/apache/cassandra/db/compaction/LeveledCompactionStrategy.java
+++ b/src/java/org/apache/cassandra/db/compaction/LeveledCompactionStrategy.java
@@ -181,7 +181,9 @@ public class LeveledCompactionStrategy extends 
AbstractCompactionStrategy implem
         List<ICompactionScanner> scanners = new 
ArrayList<ICompactionScanner>(sstables.size());
         for (Integer level : byLevel.keySet())
         {
-            if (level == 0)
+            // level can be -1 when sstables are added to DataTracker but not 
to LeveledManifest
+            // since we don't know which level those sstable belong yet, we 
simply do the same as L0 sstables.
+            if (level <= 0)
             {
                 // L0 makes no guarantees about overlapping-ness.  Just create 
a direct scanner for each
                 for (SSTableReader sstable : byLevel.get(level))

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e1491f3f/test/unit/org/apache/cassandra/db/compaction/LeveledCompactionStrategyTest.java
----------------------------------------------------------------------
diff --git 
a/test/unit/org/apache/cassandra/db/compaction/LeveledCompactionStrategyTest.java
 
b/test/unit/org/apache/cassandra/db/compaction/LeveledCompactionStrategyTest.java
index 9392195..051aff8 100644
--- 
a/test/unit/org/apache/cassandra/db/compaction/LeveledCompactionStrategyTest.java
+++ 
b/test/unit/org/apache/cassandra/db/compaction/LeveledCompactionStrategyTest.java
@@ -64,7 +64,7 @@ public class LeveledCompactionStrategyTest extends 
SchemaLoader
                 rm.add(new QueryPath(cfname, null, 
ByteBufferUtil.bytes("column" + c)), value, 0);
             }
             rm.apply();
-            store.forceFlush();
+            store.forceBlockingFlush();
         }
 
         LeveledCompactionStrategy strat = 
(LeveledCompactionStrategy)store.getCompactionStrategy();

Reply via email to