mirror of https://github.com/apache/cassandra
Make PeriodicCommitLogService.blockWhenSyncLagsNanos configurable
patch by jasobrown; reviewed by Jordan West for CASSANDRA-14580
This commit is contained in:
parent
9abeff38c4
commit
176d4bac22
|
|
@ -1,4 +1,5 @@
|
|||
4.0
|
||||
* Make PeriodicCommitLogService.blockWhenSyncLagsNanos configurable (CASSANDRA-14580)
|
||||
* Improve logging in MessageInHandler's constructor (CASSANDRA-14576)
|
||||
* Set broadcast address in internode messaging handshake (CASSANDRA-14579)
|
||||
* Wait for schema agreement prior to building MVs (CASSANDRA-14571)
|
||||
|
|
|
|||
|
|
@ -389,6 +389,10 @@ counter_cache_save_period: 7200
|
|||
commitlog_sync: periodic
|
||||
commitlog_sync_period_in_ms: 10000
|
||||
|
||||
# When in periodic commitlog mode, the number of milliseconds to block writes
|
||||
# while waiting for a slow disk flush to complete.
|
||||
# periodic_commitlog_sync_lag_block_in_ms:
|
||||
|
||||
# The size of the individual commitlog file segments. A commitlog
|
||||
# segment may be archived, deleted, or recycled once all the data
|
||||
# in it (potentially from each columnfamily in the system) has been
|
||||
|
|
|
|||
|
|
@ -204,6 +204,7 @@ public class Config
|
|||
public int commitlog_segment_size_in_mb = 32;
|
||||
public ParameterizedClass commitlog_compression;
|
||||
public int commitlog_max_compression_buffers_in_pool = 3;
|
||||
public Integer periodic_commitlog_sync_lag_block_in_ms;
|
||||
public TransparentDataEncryptionOptions transparent_data_encryption_options = new TransparentDataEncryptionOptions();
|
||||
|
||||
public Integer max_mutation_size_in_kb;
|
||||
|
|
|
|||
|
|
@ -1866,6 +1866,14 @@ public class DatabaseDescriptor
|
|||
return conf.commitlog_sync_period_in_ms;
|
||||
}
|
||||
|
||||
public static long getPeriodicCommitLogSyncBlock()
|
||||
{
|
||||
Integer blockMillis = conf.periodic_commitlog_sync_lag_block_in_ms;
|
||||
return blockMillis == null
|
||||
? (long)(getCommitLogSyncPeriod() * 1.5)
|
||||
: blockMillis;
|
||||
}
|
||||
|
||||
public static void setCommitLogSyncPeriod(int periodMillis)
|
||||
{
|
||||
conf.commitlog_sync_period_in_ms = periodMillis;
|
||||
|
|
|
|||
|
|
@ -17,11 +17,13 @@
|
|||
*/
|
||||
package org.apache.cassandra.db.commitlog;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.apache.cassandra.config.DatabaseDescriptor;
|
||||
|
||||
class PeriodicCommitLogService extends AbstractCommitLogService
|
||||
{
|
||||
private static final long blockWhenSyncLagsNanos = (long) (DatabaseDescriptor.getCommitLogSyncPeriod() * 1.5e6);
|
||||
private static final long blockWhenSyncLagsNanos = TimeUnit.MILLISECONDS.toNanos(DatabaseDescriptor.getPeriodicCommitLogSyncBlock());
|
||||
|
||||
public PeriodicCommitLogService(final CommitLog commitLog)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue