gavinchou commented on code in PR #45394: URL: https://github.com/apache/doris/pull/45394#discussion_r1896329316
########## cloud/src/meta-service/meta_service_http.cpp: ########## @@ -448,6 +451,31 @@ static HttpResponse process_query_rate_limit(MetaServiceImpl* service, brpc::Con return http_json_reply(MetaServiceCode::OK, "", sb.GetString()); } +static HttpResponse process_update_config(MetaServiceImpl* service, brpc::Controller* cntl) { + const auto& uri = cntl->http_request().uri(); + bool persist = (http_query(uri, "persist") == "true"); + auto configs = std::string {http_query(uri, "configs")}; + if (configs.empty()) [[unlikely]] { + return http_json_reply(MetaServiceCode::INVALID_ARGUMENT, + "query param `config` should not be empty"); + } + auto conf_list = split(configs, ','); + for (const auto& conf : conf_list) { + auto conf_pair = split(conf, '='); + if (conf_pair.size() != 2) [[unlikely]] { + return http_json_reply(MetaServiceCode::INVALID_ARGUMENT, + fmt::format("config {} is invalid", configs)); + } + trim(conf_pair[0]); + trim(conf_pair[1]); + if (!config::set_config(conf_pair[0], conf_pair[1], persist, config::custom_conf_path)) { + return http_json_reply(MetaServiceCode::INVALID_ARGUMENT, + fmt::format("set {}={} failed", conf_pair[0], conf_pair[1])); Review Comment: can we know why it fails? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org