server: disable `PersistStats` RocksDB task for v2
ref tikv/tikv#12842
@@ -1324,6 +1324,10 @@ impl DbConfig {
if let Some(r) = &shared.write_buffer_manager {
opts.set_write_buffer_manager(r);
}
+ if for_engine == EngineType::RaftKv2 {
+ // Historical stats are not used.
+ opts.set_stats_persist_period_sec(0);
+ }
opts
}
