Enable consensus compaction by default (#5903)

* Enable consensus compaction by default

* Also set new compaction default in code
This commit is contained in:
Tim Visée
2025-02-04 15:05:23 +01:00
committed by timvisee
parent 0ca44678fb
commit 6cc3ecbc30
2 changed files with 14 additions and 3 deletions

View File

@@ -324,6 +324,12 @@ cluster:
# We encourage you NOT to change this parameter unless you know what you are doing.
tick_period_ms: 100
# Compact consensus operations once we have this amount of applied
# operations. Allows peers to join quickly with a consensus snapshot without
# replaying a huge amount of operations.
# If 0 - disable compaction
compact_wal_entries: 128
# Set to true to prevent service from sending usage statistics to the developers.
# Read more: https://qdrant.tech/documentation/guides/telemetry
telemetry_disabled: false

View File

@@ -114,8 +114,9 @@ pub struct ConsensusConfig {
#[validate(range(min = 1))]
#[serde(default = "default_message_timeout_tics")]
pub message_timeout_ticks: u64,
#[serde(default)]
pub compact_wal_entries: u64, // compact WAL when it grows to enough applied entries
/// Compact WAL when it grows to enough applied entries
#[serde(default = "default_compact_wal_entries")]
pub compact_wal_entries: u64,
}
impl Default for ConsensusConfig {
@@ -125,7 +126,7 @@ impl Default for ConsensusConfig {
tick_period_ms: default_tick_period_ms(),
bootstrap_timeout_sec: default_bootstrap_timeout_sec(),
message_timeout_ticks: default_message_timeout_tics(),
compact_wal_entries: 0,
compact_wal_entries: default_compact_wal_entries(),
}
}
}
@@ -383,6 +384,10 @@ const fn default_message_timeout_tics() -> u64 {
10
}
const fn default_compact_wal_entries() -> u64 {
128
}
#[allow(clippy::unnecessary_wraps)] // Used as serde default
const fn default_tls_cert_ttl() -> Option<u64> {
// Default one hour