cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From marc...@apache.org
Subject [1/2] git commit: Reference sstable before populating keycache after compaction
Date Thu, 12 Jun 2014 01:13:10 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1 99594cd68 -> 00628e70a


Reference sstable before populating keycache after compaction

Patch by marcuse; reviewed by thobbs for CASSANDRA-7234


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

Branch: refs/heads/cassandra-2.1
Commit: 2df27c090039166b3e3519688f5b7482b9d90f8c
Parents: 3e5f2bd
Author: Marcus Eriksson <marcuse@apache.org>
Authored: Mon Jun 9 13:16:32 2014 +0200
Committer: Marcus Eriksson <marcuse@apache.org>
Committed: Thu Jun 12 03:06:58 2014 +0200

----------------------------------------------------------------------
 CHANGES.txt                                           |  1 +
 .../cassandra/db/compaction/CompactionTask.java       | 14 +++++++++++++-
 2 files changed, 14 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/2df27c09/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 97ac75e..f4f7fc4 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -14,6 +14,7 @@
  * Cqlsh counts non-empty lines for "Blank lines" warning (CASSANDRA-7325)
  * Make StreamSession#closeSession() idempotent (CASSANDRA-7262)
  * Fix infinite loop on exception while streaming (CASSANDRA-7330)
+ * Reference sstables before populating key cache (CASSANDRA-7234)
 Merged from 1.2:
  * Check internal addresses for seeds (CASSANDRA-6523)
  * Fix potential / by 0 in HHOM page size calculation (CASSANDRA-7354)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/2df27c09/src/java/org/apache/cassandra/db/compaction/CompactionTask.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/compaction/CompactionTask.java b/src/java/org/apache/cassandra/db/compaction/CompactionTask.java
index 10c26db..5ef4aad 100644
--- a/src/java/org/apache/cassandra/db/compaction/CompactionTask.java
+++ b/src/java/org/apache/cassandra/db/compaction/CompactionTask.java
@@ -242,7 +242,19 @@ public class CompactionTask extends AbstractCompactionTask
         replaceCompactedSSTables(toCompact, sstables);
         // TODO: this doesn't belong here, it should be part of the reader to load when the
tracker is wired up
         for (SSTableReader sstable : sstables)
-            sstable.preheat(cachedKeyMap.get(sstable.descriptor));
+        {
+            if (sstable.acquireReference())
+            {
+                try
+                {
+                    sstable.preheat(cachedKeyMap.get(sstable.descriptor));
+                }
+                finally
+                {
+                    sstable.releaseReference();
+                }
+            }
+        }
 
         // log a bunch of statistics about the result and save to system table compaction_history
         long dTime = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - start);


Mime
View raw message