You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by sn...@apache.org on 2015/02/17 17:28:34 UTC

[2/6] cassandra git commit: AssertionError: "Memory was freed" when running cleanup

AssertionError: "Memory was freed" when running cleanup

Patch by Robert Stupp; Reviewed by Benedict Elliott Smith for CASSANDRA-8716


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

Branch: refs/heads/cassandra-2.1
Commit: 7f10cbd8ad7b4ea1f7471084eeb935fe911845bb
Parents: 93769b3
Author: Robert Stupp <sn...@snazy.de>
Authored: Tue Feb 17 17:25:53 2015 +0100
Committer: Robert Stupp <sn...@snazy.de>
Committed: Tue Feb 17 17:25:53 2015 +0100

----------------------------------------------------------------------
 CHANGES.txt                                                 | 1 +
 .../apache/cassandra/db/compaction/CompactionManager.java   | 9 +++++----
 2 files changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/7f10cbd8/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 2052f70..24f70a3 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.0.13:
+ * AssertionError: "Memory was freed" when running cleanup (CASSANDRA-8716)
  * Make it possible to set max_sstable_age to fractional days (CASSANDRA-8406)
  * Fix memory leak in SSTableSimple*Writer and SSTableReader.validate() (CASSANDRA-8748)
  * Fix some multi-column relations with indexes on some clustering

http://git-wip-us.apache.org/repos/asf/cassandra/blob/7f10cbd8/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/compaction/CompactionManager.java b/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
index 62599e3..0978ae6 100644
--- a/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
+++ b/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
@@ -539,9 +539,10 @@ public class CompactionManager implements CompactionManagerMBean
 
         for (SSTableReader sstable : sstables)
         {
+            Set<SSTableReader> sstableAsSet = Collections.singleton(sstable);
             if (!hasIndexes && !new Bounds<Token>(sstable.first.token, sstable.last.token).intersects(ranges))
             {
-                cfs.replaceCompactedSSTables(Arrays.asList(sstable), Collections.<SSTableReader>emptyList(), OperationType.CLEANUP);
+                cfs.replaceCompactedSSTables(sstableAsSet, Collections.<SSTableReader>emptyList(), OperationType.CLEANUP);
                 continue;
             }
             if (!needsCleanup(sstable, ranges))
@@ -550,18 +551,18 @@ public class CompactionManager implements CompactionManagerMBean
                 continue;
             }
 
-            CompactionController controller = new CompactionController(cfs, Collections.singleton(sstable), getDefaultGcBefore(cfs));
+            CompactionController controller = new CompactionController(cfs, sstableAsSet, getDefaultGcBefore(cfs));
             long start = System.nanoTime();
 
             long totalkeysWritten = 0;
 
             int expectedBloomFilterSize = Math.max(cfs.metadata.getIndexInterval(),
-                                                   (int) (SSTableReader.getApproximateKeyCount(Arrays.asList(sstable), cfs.metadata)));
+                                                   (int) (SSTableReader.getApproximateKeyCount(sstableAsSet, cfs.metadata)));
             if (logger.isDebugEnabled())
                 logger.debug("Expected bloom filter size : " + expectedBloomFilterSize);
 
             logger.info("Cleaning up " + sstable);
-            File compactionFileLocation = cfs.directories.getWriteableLocationAsFile(cfs.getExpectedCompactedFileSize(sstables, OperationType.CLEANUP));
+            File compactionFileLocation = cfs.directories.getWriteableLocationAsFile(cfs.getExpectedCompactedFileSize(sstableAsSet, OperationType.CLEANUP));
             if (compactionFileLocation == null)
                 throw new IOException("disk full");