From 0da702df39b6cfd41f1c7988914eec7c00d1a443 Mon Sep 17 00:00:00 2001 From: yi-xmu Date: Thu, 14 Aug 2025 12:32:24 +0800 Subject: [PATCH 1/2] feat: config cloud worker count for eloqstore cloud --- storage/eloq/ha_eloq.cc | 13 ++++++++++++- storage/eloq/store_handler | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/storage/eloq/ha_eloq.cc b/storage/eloq/ha_eloq.cc index f8046b63a2b..6b6b943de51 100644 --- a/storage/eloq/ha_eloq.cc +++ b/storage/eloq/ha_eloq.cc @@ -377,6 +377,7 @@ static char *eloq_eloqstore_data_path= nullptr; static unsigned int eloq_eloqstore_open_files_limit= 1024; static char *eloq_eloqstore_cloud_store_path= nullptr; static unsigned int eloq_eloqstore_gc_threads= 1; +static unsigned int eloq_eloqstore_cloud_worker_count= 1; #endif const char *enum_var_names[]= {"e1", "e2", NullS}; @@ -1064,6 +1065,11 @@ static MYSQL_SYSVAR_UINT(eloqstore_gc_threads, eloq_eloqstore_gc_threads, "EloqStore server gc threads count (Must be 0 when " "cloud store is enabled).", NULL, NULL, 1, 0, UINT_MAX, 1); +static MYSQL_SYSVAR_UINT(eloqstore_cloud_worker_count, + eloq_eloqstore_cloud_worker_count, + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, + "EloqStore server cloud worker count", NULL, NULL, 1, + 1, UINT_MAX, 1); #endif static struct st_mysql_sys_var *eloq_system_variables[]= { @@ -1177,6 +1183,7 @@ static struct st_mysql_sys_var *eloq_system_variables[]= { MYSQL_SYSVAR(eloqstore_open_files_limit), MYSQL_SYSVAR(eloqstore_cloud_store_path), MYSQL_SYSVAR(eloqstore_gc_threads), + MYSQL_SYSVAR(eloqstore_cloud_worker_count), #endif NULL}; @@ -2540,6 +2547,7 @@ static int eloq_init_func(void *p) eloq_store_config.gc_threads_= !eloq_store_config.cloud_store_path_.empty() ? 0 : eloq_eloqstore_gc_threads; + eloq_store_config.cloud_worker_count_= eloq_eloqstore_cloud_worker_count; LOG_IF(INFO, !eloq_store_config.cloud_store_path_.empty()) << "EloqStore cloud store enabled."; auto ds_factory= @@ -2572,7 +2580,9 @@ static int eloq_init_func(void *p) << ", max open files: " << eloq_store_config.open_files_limit_ << ", cloud store path: " << eloq_store_config.cloud_store_path_ - << ", gc threads: " << eloq_store_config.gc_threads_; + << ", gc threads: " << eloq_store_config.gc_threads_ + << ", cloud worker count: " + << eloq_store_config.cloud_worker_count_; ::eloqstore::KvOptions store_config; store_config.num_threads= eloq_store_config.worker_count_; store_config.store_path.emplace_back() @@ -2589,6 +2599,7 @@ static int eloq_init_func(void *p) .append(std::to_string(shard_id)); } store_config.num_gc_threads= eloq_store_config.gc_threads_; + store_config.rclone_threads= eloq_store_config.cloud_worker_count_; auto ds= std::make_unique( shard_id, data_store_service_.get(), store_config); #endif diff --git a/storage/eloq/store_handler b/storage/eloq/store_handler index 53361ccdc1a..7b8f22e4317 160000 --- a/storage/eloq/store_handler +++ b/storage/eloq/store_handler @@ -1 +1 @@ -Subproject commit 53361ccdc1a87b28fc43e55be1b2a9df5b14e78d +Subproject commit 7b8f22e4317b74d1fc96ca580375b4d0874e76aa From 6bec24a5c88c2868dcd64494c53eec900cf2e356 Mon Sep 17 00:00:00 2001 From: yi-xmu Date: Thu, 14 Aug 2025 14:52:07 +0800 Subject: [PATCH 2/2] fix open files limit config --- storage/eloq/ha_eloq.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/storage/eloq/ha_eloq.cc b/storage/eloq/ha_eloq.cc index 6b6b943de51..d5649d0fa37 100644 --- a/storage/eloq/ha_eloq.cc +++ b/storage/eloq/ha_eloq.cc @@ -2589,8 +2589,7 @@ static int eloq_init_func(void *p) .append(eloq_store_config.storage_path_) .append("/ds_") .append(std::to_string(shard_id)); - store_config.fd_limit= eloq_store_config.open_files_limit_ / - eloq_store_config.worker_count_; + store_config.fd_limit= eloq_store_config.open_files_limit_; if (!eloq_store_config.cloud_store_path_.empty()) { store_config.cloud_store_path