Add property to disable stcs in L0

Patch by marcuse; reviewed by tjake for CASSANDRA-6621
This commit is contained in:
Marcus Eriksson 2014-06-27 08:56:50 +02:00
parent 4c95d08480
commit f39cb073ac
4 changed files with 17 additions and 1 deletions

View File

@ -8,6 +8,7 @@
* Fix AssertionError when using empty clustering columns and static columns
(CASSANDRA-7455)
* Add inter_dc_stream_throughput_outbound_megabits_per_sec (CASSANDRA-6596)
* Add option to disable STCS in L0 (CASSANDRA-6621)
Merged from 1.2:

View File

@ -13,6 +13,15 @@ restore snapshots created with the previous major version using the
'sstableloader' tool. You can upgrade the file format of your snapshots
using the provided 'sstableupgrade' tool.
2.0.10
====
New features
------------
- If you are using Leveled Compaction, you can now disable doing size-tiered
compaction in L0 by starting Cassandra with -Dcassandra.disable_stcs_in_l0
(see CASSANDRA-6621 for details).
2.0.9
=====

View File

@ -904,6 +904,11 @@ public class DatabaseDescriptor
conf.compaction_throughput_mb_per_sec = value;
}
public static boolean getDisableSTCSInL0()
{
return Boolean.getBoolean("cassandra.disable_stcs_in_l0");
}
public static int getStreamThroughputOutboundMegabitsPerSec()
{
return conf.stream_throughput_outbound_megabits_per_sec;

View File

@ -34,6 +34,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.cassandra.config.CFMetaData;
import org.apache.cassandra.config.DatabaseDescriptor;
import org.apache.cassandra.config.Schema;
import org.apache.cassandra.db.ColumnFamilyStore;
import org.apache.cassandra.db.RowPosition;
@ -267,7 +268,7 @@ public class LeveledManifest
if (score > 1.001)
{
// before proceeding with a higher level, let's see if L0 is far enough behind to warrant STCS
if (generations[0].size() > MAX_COMPACTING_L0)
if (!DatabaseDescriptor.getDisableSTCSInL0() && generations[0].size() > MAX_COMPACTING_L0)
{
Iterable<SSTableReader> candidates = cfs.getDataTracker().getUncompactingSSTables(generations[0]);
List<Pair<SSTableReader,Long>> pairs = SizeTieredCompactionStrategy.createSSTableAndLengthPairs(AbstractCompactionStrategy.filterSuspectSSTables(candidates));