cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From slebre...@apache.org
Subject [5/6] git commit: don't change manifest level for cleanup, scrub, and upgradesstables under LCS patch by Maki Watanabe; reviewed by jbellis for CASSANDRA-3989
Date Sun, 04 Mar 2012 10:17:37 GMT
don't change manifest level for cleanup, scrub, and upgradesstables under LCS
patch by Maki Watanabe; reviewed by jbellis for CASSANDRA-3989


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

Branch: refs/heads/trunk
Commit: 5d03d6029ac7b439c64348f429dec2ad6a6077d0
Parents: 0c2d2cc
Author: Jonathan Ellis <jbellis@apache.org>
Authored: Fri Mar 2 12:28:36 2012 -0600
Committer: Jonathan Ellis <jbellis@apache.org>
Committed: Fri Mar 2 12:34:03 2012 -0600

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


http://git-wip-us.apache.org/repos/asf/cassandra/blob/5d03d602/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 76bb8cb..4584383 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -22,6 +22,8 @@ Merged from 1.0:
  * (cqlsh) ignore missing CfDef opts (CASSANDRA-3933)
  * (cqlsh) look for cqlshlib relative to realpath (CASSANDRA-3767)
  * Fix short read protection (CASSANDRA-3934)
+ * don't change manifest level for cleanup, scrub, and upgradesstables
+   operations under LeveledCompactionStrategy (CASSANDRA-3989)
  * always compact away deleted hints immediately after handoff (CASSANDRA-3955)
  * delete hints from dropped ColumnFamilies on handoff instead of
    erroring out (CASSANDRA-3975)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/5d03d602/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 4c63180..a546cbc 100644
--- a/src/java/org/apache/cassandra/db/compaction/LeveledManifest.java
+++ b/src/java/org/apache/cassandra/db/compaction/LeveledManifest.java
@@ -61,7 +61,6 @@ public class LeveledManifest
     private final List<SSTableReader>[] generations;
     private final RowPosition[] lastCompactedKeys;
     private final int maxSSTableSizeInMB;
-    private int levelCount;
 
     private LeveledManifest(ColumnFamilyStore cfs, int maxSSTableSizeInMB)
     {
@@ -175,7 +174,13 @@ public class LeveledManifest
         if (!added.iterator().hasNext())
             return;
 
-        int newLevel = minimumLevel == maximumLevel ? maximumLevel + 1 : maximumLevel;
+        // avoid increasing the level if we had a single source sstable involved.  This prevents
+        // cleanup, scrub, and upgradesstables from blowing through the level cap.
+        // See CASSANDRA-3989
+        int newLevel = Iterables.size(removed) == 1
+                     ? maximumLevel
+                     : minimumLevel == maximumLevel ? maximumLevel + 1 : maximumLevel;
+
         newLevel = skipLevels(newLevel, added);
         assert newLevel > 0;
         if (logger.isDebugEnabled())
@@ -295,6 +300,7 @@ public class LeveledManifest
 
     private void add(SSTableReader sstable, int level)
     {
+        assert level < generations.length : "Invalid level " + level + " out of " + (generations.length
- 1);
         generations[level].add(sstable);
     }
 


Mime
View raw message