mirror of https://github.com/apache/cassandra
Add option to disable compaction at startup
Patch by David Capwell, reviewed by brandonwilliams for CASSANDRA-15927
This commit is contained in:
parent
6912d32b7d
commit
c21cde119d
|
|
@ -1,4 +1,5 @@
|
|||
4.0-alpha5
|
||||
* Add option to disable compaction at startup (CASSANDRA-15927)
|
||||
* FBUtilities.getJustLocalAddress falls back to lo ip on misconfigured nodes (CASSANDRA-15901)
|
||||
* Close channel and reduce buffer allocation during entire sstable streaming with SSL (CASSANDRA-15900)
|
||||
* Prune expired messages less frequently in internode messaging (CASSANDRA-15700)
|
||||
|
|
|
|||
|
|
@ -521,6 +521,8 @@ public class Config
|
|||
public volatile boolean check_for_duplicate_rows_during_reads = true;
|
||||
public volatile boolean check_for_duplicate_rows_during_compaction = true;
|
||||
|
||||
public boolean autocompaction_on_startup_enabled = Boolean.parseBoolean(System.getProperty("cassandra.autocompaction_on_startup_enabled", "true"));
|
||||
|
||||
/**
|
||||
* Client mode means that the process is a pure client, that uses C* code base but does
|
||||
* not read or write local C* database files.
|
||||
|
|
|
|||
|
|
@ -3154,4 +3154,9 @@ public class DatabaseDescriptor
|
|||
{
|
||||
conf.range_tombstone_list_growth_factor = resizeFactor;
|
||||
}
|
||||
|
||||
public static boolean getAutocompactionOnStartupEnabled()
|
||||
{
|
||||
return conf.autocompaction_on_startup_enabled;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -404,7 +404,14 @@ public class CassandraDaemon
|
|||
store.reload(); //reload CFs in case there was a change of disk boundaries
|
||||
if (store.getCompactionStrategyManager().shouldBeEnabled())
|
||||
{
|
||||
store.enableAutoCompaction();
|
||||
if (DatabaseDescriptor.getAutocompactionOnStartupEnabled())
|
||||
{
|
||||
store.enableAutoCompaction();
|
||||
}
|
||||
else
|
||||
{
|
||||
logger.info("Not enabling compaction for {}.{}; autocompaction_on_startup_enabled is set to false", store.keyspace.getName(), store.name);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue