diff --git a/contrib/tiflash-proxy b/contrib/tiflash-proxy index 70da4ccad80..601d803562c 160000 --- a/contrib/tiflash-proxy +++ b/contrib/tiflash-proxy @@ -1 +1 @@ -Subproject commit 70da4ccad80bab4fe9235bd4e1fe203226347a2a +Subproject commit 601d803562cde9a7fe8d17120d073aea55ae1012 diff --git a/dbms/src/Server/Server.cpp b/dbms/src/Server/Server.cpp index 0bb0c682bf2..31bbd5483ea 100644 --- a/dbms/src/Server/Server.cpp +++ b/dbms/src/Server/Server.cpp @@ -1023,25 +1023,15 @@ int Server::main(const std::vector & /*args*/) }); /// get CPU/memory/disk info of this server - if (tiflash_instance_wrap.proxy_helper) - { - diagnosticspb::ServerInfoRequest request; - request.set_tp(static_cast(1)); - diagnosticspb::ServerInfoResponse response; - std::string req = request.SerializeAsString(); - auto * helper = tiflash_instance_wrap.proxy_helper; - helper->fn_server_info(helper->proxy_ptr, strIntoView(&req), &response); - server_info.parseSysInfo(response); - setNumberOfLogicalCPUCores(server_info.cpu_info.logical_cores); - computeAndSetNumberOfPhysicalCPUCores(server_info.cpu_info.logical_cores, server_info.cpu_info.physical_cores); - LOG_INFO(log, "ServerInfo: {}", server_info.debugString()); - } - else - { - setNumberOfLogicalCPUCores(std::thread::hardware_concurrency()); - computeAndSetNumberOfPhysicalCPUCores(std::thread::hardware_concurrency(), std::thread::hardware_concurrency() / 2); - LOG_INFO(log, "TiFlashRaftProxyHelper is null, failed to get server info"); - } + diagnosticspb::ServerInfoRequest request; + diagnosticspb::ServerInfoResponse response; + request.set_tp(static_cast(1)); + std::string req = request.SerializeAsString(); + ffi_get_server_info_from_proxy(reinterpret_cast(&helper), strIntoView(&req), &response); + server_info.parseSysInfo(response); + setNumberOfLogicalCPUCores(server_info.cpu_info.logical_cores); + computeAndSetNumberOfPhysicalCPUCores(server_info.cpu_info.logical_cores, server_info.cpu_info.physical_cores); + LOG_INFO(log, "ServerInfo: {}", server_info.debugString()); grpc_log = Logger::get("grpc"); gpr_set_log_verbosity(GPR_LOG_SEVERITY_DEBUG);