Reference sstable before populating keycache after compaction

Patch by marcuse; reviewed by thobbs for CASSANDRA-7234
This commit is contained in:
Marcus Eriksson 2014-06-09 13:16:32 +02:00
parent 3e5f2bd64e
commit 2df27c0900
2 changed files with 14 additions and 1 deletions

View File

@ -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)

View File

@ -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);