cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbros...@apache.org
Subject [1/3] git commit: Fix dealing with ridiculously large max sstable sizes in LCS patch by jbellis; reviewed by marcuse for CASSANDRA-5589
Date Fri, 24 May 2013 02:56:53 GMT
Updated Branches:
  refs/heads/trunk b2ba251ac -> 778b6a0eb


Fix dealing with ridiculously large max sstable sizes in LCS
patch by jbellis; reviewed by marcuse for CASSANDRA-5589


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

Branch: refs/heads/trunk
Commit: 03f0116611795836009ea488dd8035b70641ecb3
Parents: cc301de
Author: Jonathan Ellis <jbellis@apache.org>
Authored: Thu May 23 14:50:49 2013 -0500
Committer: Jonathan Ellis <jbellis@apache.org>
Committed: Thu May 23 14:50:49 2013 -0500

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


http://git-wip-us.apache.org/repos/asf/cassandra/blob/03f01166/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 66c5f04..b687570 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 1.2.6
+ * Fix dealing with ridiculously large max sstable sizes in LCS (CASSANDRA-5589)
  * Ignore pre-truncate hints (CASSANDRA-4655)
  * Move System.exit on OOM into a separate thread (CASSANDRA-5273)
  * Write row markers when serializing schema (CASSANDRA-5572)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/03f01166/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 f964297..52c03fc 100644
--- a/src/java/org/apache/cassandra/db/compaction/LeveledCompactionStrategy.java
+++ b/src/java/org/apache/cassandra/db/compaction/LeveledCompactionStrategy.java
@@ -57,6 +57,11 @@ public class LeveledCompactionStrategy extends AbstractCompactionStrategy
implem
         {
             String value = options.containsKey(SSTABLE_SIZE_OPTION) ? options.get(SSTABLE_SIZE_OPTION)
: "5";
             configuredMaxSSTableSize = Integer.parseInt(value);
+            if (configuredMaxSSTableSize >= 1000)
+            {
+                // Yes, people have done this
+                logger.warn("Max sstable size of {}MB is configured; having a unit of compaction
this large is probably a bad idea", configuredMaxSSTableSize);
+            }
         }
         maxSSTableSizeInMB = configuredMaxSSTableSize;
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/03f01166/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 864e70c..f62c796 100644
--- a/src/java/org/apache/cassandra/db/compaction/LeveledManifest.java
+++ b/src/java/org/apache/cassandra/db/compaction/LeveledManifest.java
@@ -70,8 +70,10 @@ public class LeveledManifest
         this.cfs = cfs;
         this.maxSSTableSizeInBytes = maxSSTableSizeInMB * 1024 * 1024;
 
-        // allocate enough generations for a PB of data
-        int n = (int) Math.log10(1000 * 1000 * 1000 / maxSSTableSizeInMB);
+        // allocate enough generations for a PB of data, with a 1-MB sstable size.  (Note
that if maxSSTableSize is
+        // updated, we will still have sstables of the older, potentially smaller size. 
So don't make this
+        // dependent on maxSSTableSize.)
+        int n = (int) Math.log10(1000 * 1000 * 1000);
         generations = new List[n];
         lastCompactedKeys = new RowPosition[n];
         for (int i = 0; i < generations.length; i++)


Mime
View raw message