cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject [2/3] git commit: Fix setting last compacted key in the wrong level for LCS patch by Jiri Horky; reviewed by jbellis for CASSANDRA-6284
Date Fri, 22 Nov 2013 23:07:43 GMT
Fix setting last compacted key in the wrong level for LCS
patch by Jiri Horky; reviewed by jbellis for CASSANDRA-6284


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

Branch: refs/heads/trunk
Commit: 02a93025e1db826216e4c24fbe6b5949405e4826
Parents: 4fd322f
Author: Jonathan Ellis <jbellis@apache.org>
Authored: Fri Nov 22 17:06:08 2013 -0600
Committer: Jonathan Ellis <jbellis@apache.org>
Committed: Fri Nov 22 17:06:13 2013 -0600

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


http://git-wip-us.apache.org/repos/asf/cassandra/blob/02a93025/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 8163c94..e85ba23 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,3 +1,7 @@
+2.0.4
+ * Fix setting last compacted key in the wrong level for LCS (CASSANDRA-6284)
+
+
 2.0.3
  * Fix FD leak on slice read path (CASSANDRA-6275)
  * Cancel read meter task when closing SSTR (CASSANDRA-6358)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/02a93025/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 7348c29..5690bd8 100644
--- a/src/java/org/apache/cassandra/db/compaction/LeveledManifest.java
+++ b/src/java/org/apache/cassandra/db/compaction/LeveledManifest.java
@@ -137,8 +137,13 @@ public class LeveledManifest
 
         // the level for the added sstables is the max of the removed ones,
         // plus one if the removed were all on the same level
+        int minLevel = Integer.MAX_VALUE;
+
         for (SSTableReader sstable : removed)
-            remove(sstable);
+        {
+            int thisLevel = remove(sstable);
+            minLevel = Math.min(minLevel, thisLevel);
+        }
 
         // it's valid to do a remove w/o an add (e.g. on truncate)
         if (added.isEmpty())
@@ -147,12 +152,8 @@ public class LeveledManifest
         if (logger.isDebugEnabled())
             logger.debug("Adding [{}]", toString(added));
 
-        int minLevel = Integer.MAX_VALUE;
         for (SSTableReader ssTableReader : added)
-        {
-            minLevel = Math.min(minLevel, ssTableReader.getSSTableLevel());
             add(ssTableReader);
-        }
         lastCompactedKeys[minLevel] = SSTable.sstableOrdering.max(added).last;
     }
 


Mime
View raw message