army
(Army)
2025 年5 月 6 日 05:55
1
【TiDB 使用环境】测试环境
【TiDB 版本】v8.5.1
【操作系统】AlmaLinux release 9.1 (Lime Lynx)
【部署方式】本地部署
【配置】tikv:40C256G
【集群数据量】50G
【集群节点数】11
【问题复现路径】v7.5.0升级至v8.5.1,集群参数raft-engine.batch-compression-threshold默认值8K
【遇到的问题:问题现象及影响】
在tikv的配置文件中,强制指定参数值为8K,仍然会在启动过程中出现以下日志被自动调整回4K
[2025/05/05 11:35:15.896 +08:00] [WARN] [mod.rs:2028] [“raft-engine.batch-compression-threshold 8KiB should be adpative to the size of async-io. Set it to 4KiB instead.”] [thread_id=1]
【资源配置】进入到 TiDB Dashboard -集群信息 (Cluster Info) -主机(Hosts) 截图此页面
【复制黏贴 ERROR 报错的日志】
有没有试过 reload 集群,然后 restart -N TiKV 试试?
army
(Army)
2025 年5 月 6 日 06:07
3
试过,升级版本之后,reload -R tikv以及restart都试过了
补充一个报错,从报错来看是因为 async-io 不足,自动调整会 4KiB,没有办法调整到 8KiB 参数值
1 个赞
有猫万事足
2025 年5 月 6 日 06:54
6
fn optimize_for(&mut self, raft_store: &RaftstoreConfig, raft_kv_v2: bool) {
if raft_kv_v2 {
return;
}
let default_config = RawRaftEngineConfig::default();
let cur_batch_compression_thd = self.config().batch_compression_threshold;
// Currently, it only takes whether the configuration
// batch-compression-threshold of RaftEngine are set manually
// into consideration to determine whether the RaftEngine is customized.
let customized = cur_batch_compression_thd != default_config.batch_compression_threshold;
// As the async-io is enabled by default (raftstore.store_io_pool_size == 1),
// testing records shows that using 4kb as the default value can achieve
// better performance and reduce the IO overhead.
// Meanwhile, the batch_compression_threshold cannot be modified dynamically if
// the threads count of async-io are changed manually.
if !customized && raft_store.store_io_pool_size > 0 {
let adaptive_batch_comp_thd = RaftEngineReadableSize(std::cmp::max(
cur_batch_compression_thd.0 / (raft_store.store_io_pool_size + 1) as u64,
RaftEngineReadableSize::kb(4).0,
));
self.mut_config().batch_compression_threshold = adaptive_batch_comp_thd;
这块代码是这样的。
里面的async-io指得是raftstore.store_io_pool_size这个设置大于0.
注释说测试数据显示这样会有更好的性能,并且如果发现你手动修改raftstore.store_io_pool_size,将无法动态设置raft-engine.batch-compression-threshold。
确实有点霸道,逻辑也确实有点乱,连续两个!=,其实就是raft-engine.batch-compression-threshold是默认值,那么一定会被设置为4k。
1 个赞
system
(system)
关闭
2025 年5 月 13 日 06:57
8
此话题已在最后回复的 7 天后被自动关闭。不再允许新回复。