diff --git a/etc/config-template.toml b/etc/config-template.toml index 4b33b6a000b..ab805b077a2 100644 --- a/etc/config-template.toml +++ b/etc/config-template.toml @@ -949,7 +949,7 @@ [raft-engine] ## Determines whether to use Raft Engine to store raft logs. When it is ## enabled, configurations of `raftdb` are ignored. -# enable = false +# enable = true ## The directory at which raft log files are stored. If the directory does not ## exist, it will be created when TiKV is started. diff --git a/src/config.rs b/src/config.rs index 8ade86eb3d7..19dd27e8304 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1409,7 +1409,7 @@ impl RaftDbConfig { } } -#[derive(Clone, Serialize, Deserialize, Debug, PartialEq, Default)] +#[derive(Clone, Serialize, Deserialize, Debug, PartialEq)] #[serde(default, rename_all = "kebab-case")] pub struct RaftEngineConfig { pub enable: bool, @@ -1417,6 +1417,15 @@ pub struct RaftEngineConfig { config: RawRaftEngineConfig, } +impl Default for RaftEngineConfig { + fn default() -> Self { + Self { + enable: true, + config: RawRaftEngineConfig::default(), + } + } +} + impl RaftEngineConfig { fn validate(&mut self) -> Result<(), Box> { self.config.sanitize().map_err(Box::new)?;