[fuzzy](test) be fuzzy conf (#14654)

This commit is contained in:
Dongyang Li
2022-11-29 19:38:40 +08:00
committed by GitHub
parent 03aa5572da
commit 22883e7e08
4 changed files with 31 additions and 3 deletions

View File

@ -861,6 +861,9 @@ CONF_String(jvm_max_heap_size, "1024M");
// enable java udf and jdbc scannode
CONF_Bool(enable_java_support, "true");
// Set config randomly to check more issues in github workflow
CONF_Bool(enable_fuzzy_mode, "false");
#ifdef BE_TEST
// test s3
CONF_String(test_s3_resource, "resource");

View File

@ -406,13 +406,14 @@ bool persist_config(const std::string& field, const std::string& value) {
return tmp_props.dump(conffile);
}
Status set_config(const std::string& field, const std::string& value, bool need_persist) {
Status set_config(const std::string& field, const std::string& value, bool need_persist,
bool force) {
auto it = Register::_s_field_map->find(field);
if (it == Register::_s_field_map->end()) {
return Status::NotFound("'{}' is not found", field);
}
if (!it->second.valmutable) {
if (!force && !it->second.valmutable) {
return Status::NotSupported("'{}' is not support to modify", field);
}
@ -432,6 +433,20 @@ Status set_config(const std::string& field, const std::string& value, bool need_
it->second.type);
}
Status set_fuzzy_config(const std::string& field, const std::string& value) {
return set_config(field, value, false, true);
}
void set_fuzzy_configs() {
// random value true or false
Status s =
set_fuzzy_config("disable_storage_page_cache", ((rand() % 2) == 0) ? "true" : "false");
LOG(INFO) << s.to_string();
// random value from 8 to 48
// s = set_fuzzy_config("doris_scanner_thread_pool_thread_num", std::to_string((rand() % 41) + 8));
// LOG(INFO) << s.to_string();
}
std::mutex* get_mutable_string_config_lock() {
return &mutable_string_config_lock;
}

View File

@ -174,7 +174,8 @@ extern std::mutex custom_conf_lock;
bool init(const char* conf_file, bool fill_conf_map = false, bool must_exist = true,
bool set_to_default = true);
Status set_config(const std::string& field, const std::string& value, bool need_persist = false);
Status set_config(const std::string& field, const std::string& value, bool need_persist = false,
bool force = false);
bool persist_config(const std::string& field, const std::string& value);
@ -182,5 +183,9 @@ std::mutex* get_mutable_string_config_lock();
std::vector<std::vector<std::string>> get_config_info();
Status set_fuzzy_config(const std::string& field, const std::string& value);
void set_fuzzy_configs();
} // namespace config
} // namespace doris

View File

@ -319,6 +319,11 @@ int main(int argc, char** argv) {
return -1;
}
if (doris::config::enable_fuzzy_mode) {
LOG(INFO) << "enable_fuzzy_mode is true, set fuzzy configs";
doris::config::set_fuzzy_configs();
}
#if !defined(__SANITIZE_ADDRESS__) && !defined(ADDRESS_SANITIZER) && !defined(LEAK_SANITIZER) && \
!defined(THREAD_SANITIZER) && !defined(USE_JEMALLOC)
// Change the total TCMalloc thread cache size if necessary.