File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -298,7 +298,13 @@ Status StorageEngine::_open() {
298298 auto dirs = get_stores ();
299299 RETURN_IF_ERROR (load_data_dirs (dirs));
300300
301- _disk_num = cast_set<int >(dirs.size ());
301+ if (config::is_cloud_mode ()) {
302+ // (Refrian) In cloud mode, the number of flush threads currently depends on the file cache setting.
303+ // A more precise adaptive algorithm is needed.
304+ _disk_num = cast_set<int >(io::FileCacheFactory::instance ()->get_cache_instance_size ());
305+ } else {
306+ _disk_num = cast_set<int >(dirs.size ());
307+ }
302308 _memtable_flush_executor = std::make_unique<MemTableFlushExecutor>();
303309 _memtable_flush_executor->init (_disk_num);
304310
Original file line number Diff line number Diff line change @@ -177,6 +177,8 @@ class BaseStorageEngine {
177177
178178 int64_t _memory_limitation_bytes_for_schema_change;
179179
180+ // The value depends on the number of `storage_root_path` parameters in non-cloud mode,
181+ // or the number of `file_cache_path` parameters in cloud mode.
180182 int _disk_num {-1 };
181183
182184 std::shared_ptr<StreamLoadRecorder> _stream_load_recorder;
You can’t perform that action at this time.
0 commit comments