Merge branch 'cassandra-3.9' into trunk

This commit is contained in:
Carl Yeksigian 2016-07-26 08:59:12 -04:00
commit d8ca69c01d
7 changed files with 38 additions and 1 deletions

View File

@ -20,6 +20,7 @@
* cqlsh: Fix handling of $$-escaped strings (CASSANDRA-12189) * cqlsh: Fix handling of $$-escaped strings (CASSANDRA-12189)
* Fix SSL JMX requiring truststore containing server cert (CASSANDRA-12109) * Fix SSL JMX requiring truststore containing server cert (CASSANDRA-12109)
Merged from 3.0: Merged from 3.0:
* Add option to override compaction space check (CASSANDRA-12180)
* Faster startup by only scanning each directory for temporary files once (CASSANDRA-12114) * Faster startup by only scanning each directory for temporary files once (CASSANDRA-12114)
* Respond with v1/v2 protocol header when responding to driver that attempts * Respond with v1/v2 protocol header when responding to driver that attempts
to connect with too low of a protocol version (CASSANDRA-11464) to connect with too low of a protocol version (CASSANDRA-11464)
@ -31,6 +32,7 @@ Merged from 2.2:
Merged from 2.1: Merged from 2.1:
* cannot use cql since upgrading python to 2.7.11+ (CASSANDRA-11850) * cannot use cql since upgrading python to 2.7.11+ (CASSANDRA-11850)
3.8 3.8
* Fix hdr logging for single operation workloads (CASSANDRA-12145) * Fix hdr logging for single operation workloads (CASSANDRA-12145)
* Fix SASI PREFIX search in CONTAINS mode with partial terms (CASSANDRA-12073) * Fix SASI PREFIX search in CONTAINS mode with partial terms (CASSANDRA-12073)

View File

@ -175,6 +175,7 @@ public class Config
public Integer concurrent_compactors; public Integer concurrent_compactors;
public volatile Integer compaction_throughput_mb_per_sec = 16; public volatile Integer compaction_throughput_mb_per_sec = 16;
public volatile Integer compaction_large_partition_warning_threshold_mb = 100; public volatile Integer compaction_large_partition_warning_threshold_mb = 100;
public Integer min_free_space_per_drive_in_mb = 50;
public Integer max_streaming_retries = 3; public Integer max_streaming_retries = 3;

View File

@ -1381,6 +1381,11 @@ public class DatabaseDescriptor
public static int getCompactionLargePartitionWarningThreshold() { return conf.compaction_large_partition_warning_threshold_mb * 1024 * 1024; } public static int getCompactionLargePartitionWarningThreshold() { return conf.compaction_large_partition_warning_threshold_mb * 1024 * 1024; }
public static long getMinFreeSpacePerDriveInBytes()
{
return conf.min_free_space_per_drive_in_mb * 1024L * 1024L;
}
public static boolean getDisableSTCSInL0() public static boolean getDisableSTCSInL0()
{ {
return Boolean.getBoolean("cassandra.disable_stcs_in_l0"); return Boolean.getBoolean("cassandra.disable_stcs_in_l0");

View File

@ -248,6 +248,8 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean
public volatile long sampleLatencyNanos; public volatile long sampleLatencyNanos;
private final ScheduledFuture<?> latencyCalculator; private final ScheduledFuture<?> latencyCalculator;
private volatile boolean compactionSpaceCheck = true;
public static void shutdownPostFlushExecutor() throws InterruptedException public static void shutdownPostFlushExecutor() throws InterruptedException
{ {
postFlushExecutor.shutdown(); postFlushExecutor.shutdown();
@ -1727,6 +1729,16 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean
samplerResults.cardinality, result}); samplerResults.cardinality, result});
} }
public boolean isCompactionDiskSpaceCheckEnabled()
{
return compactionSpaceCheck;
}
public void compactionDiskSpaceCheck(boolean enable)
{
compactionSpaceCheck = enable;
}
public void cleanupCache() public void cleanupCache()
{ {
Collection<Range<Token>> ranges = StorageService.instance.getLocalRanges(keyspace.getName()); Collection<Range<Token>> ranges = StorageService.instance.getLocalRanges(keyspace.getName());

View File

@ -169,4 +169,14 @@ public interface ColumnFamilyStoreMBean
* @return top <i>count</i> items for the sampler since beginLocalSampling was called * @return top <i>count</i> items for the sampler since beginLocalSampling was called
*/ */
public CompositeData finishLocalSampling(String sampler, int count) throws OpenDataException; public CompositeData finishLocalSampling(String sampler, int count) throws OpenDataException;
/*
Is Compaction space check enabled
*/
public boolean isCompactionDiskSpaceCheckEnabled();
/*
Enable/Disable compaction space check
*/
public void compactionDiskSpaceCheck(boolean enable);
} }

View File

@ -545,7 +545,8 @@ public class Directories
public long getAvailableSpace() public long getAvailableSpace()
{ {
return location.getUsableSpace(); long availableSpace = location.getUsableSpace() - DatabaseDescriptor.getMinFreeSpacePerDriveInBytes();
return availableSpace > 0 ? availableSpace : 0;
} }
@Override @Override

View File

@ -297,6 +297,12 @@ public class CompactionTask extends AbstractCompactionTask
protected void checkAvailableDiskSpace(long estimatedSSTables, long expectedWriteSize) protected void checkAvailableDiskSpace(long estimatedSSTables, long expectedWriteSize)
{ {
if(!cfs.isCompactionDiskSpaceCheckEnabled() && compactionType == OperationType.COMPACTION)
{
logger.info("Compaction space check is disabled");
return;
}
while (!getDirectories().hasAvailableDiskSpace(estimatedSSTables, expectedWriteSize)) while (!getDirectories().hasAvailableDiskSpace(estimatedSSTables, expectedWriteSize))
{ {
if (!reduceScopeForLimitedSpace()) if (!reduceScopeForLimitedSpace())