You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by jb...@apache.org on 2013/05/23 21:51:01 UTC
git commit: Fix dealing with ridiculously large max sstable sizes in
LCS patch by jbellis; reviewed by marcuse for CASSANDRA-5589
Updated Branches:
refs/heads/cassandra-1.2 cc301de4f -> 03f011661
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/cassandra-1.2
Commit: 03f0116611795836009ea488dd8035b70641ecb3
Parents: cc301de
Author: Jonathan Ellis <jb...@apache.org>
Authored: Thu May 23 14:50:49 2013 -0500
Committer: Jonathan Ellis <jb...@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++)