cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sn...@apache.org
Subject [3/6] cassandra git commit: AssertionError: "Memory was freed" when running cleanup
Date Tue, 17 Feb 2015 16:28:35 GMT
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/trunk
Commit: 7f10cbd8ad7b4ea1f7471084eeb935fe911845bb
Parents: 93769b3
Author: Robert Stupp <snazy@snazy.de>
Authored: Tue Feb 17 17:25:53 2015 +0100
Committer: Robert Stupp <snazy@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");
 


Mime
View raw message