From bb80ca4a529e8283efcee16728cb84f4dc27e276 Mon Sep 17 00:00:00 2001 From: hello-stephen Date: Mon, 28 Nov 2022 22:52:44 +0800 Subject: [PATCH 1/3] [fuzzy](test) be fuzzy conf --- be/src/common/config.h | 3 +++ be/src/common/configbase.cpp | 19 +++++++++++++++++-- be/src/common/configbase.h | 6 +++++- be/src/service/doris_main.cpp | 5 +++++ 4 files changed, 30 insertions(+), 3 deletions(-) diff --git a/be/src/common/config.h b/be/src/common/config.h index 554735b7c5400b..9bfcd02f0365bf 100644 --- a/be/src/common/config.h +++ b/be/src/common/config.h @@ -851,6 +851,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"); diff --git a/be/src/common/configbase.cpp b/be/src/common/configbase.cpp index e06988265fcb9a..70cbddc348f73d 100644 --- a/be/src/common/configbase.cpp +++ b/be/src/common/configbase.cpp @@ -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("enable_storage_vectorization", + ((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; } diff --git a/be/src/common/configbase.h b/be/src/common/configbase.h index 8e8f13b5c02e9c..03215696fa997c 100644 --- a/be/src/common/configbase.h +++ b/be/src/common/configbase.h @@ -174,7 +174,7 @@ 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 +182,9 @@ std::mutex* get_mutable_string_config_lock(); std::vector> get_config_info(); +Status set_fuzzy_config(const std::string& field, const std::string& value); + +void set_fuzzy_configs(); + } // namespace config } // namespace doris diff --git a/be/src/service/doris_main.cpp b/be/src/service/doris_main.cpp index f43d95eaa9a8dd..5be374147a66a4 100644 --- a/be/src/service/doris_main.cpp +++ b/be/src/service/doris_main.cpp @@ -320,6 +320,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. From a04f01eb9032f1a34706eb3c0c5621bb6719c43f Mon Sep 17 00:00:00 2001 From: hello-stephen Date: Tue, 29 Nov 2022 09:34:26 +0800 Subject: [PATCH 2/3] fix --- be/src/common/configbase.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/be/src/common/configbase.h b/be/src/common/configbase.h index 03215696fa997c..f0d9ed7aee0cdf 100644 --- a/be/src/common/configbase.h +++ b/be/src/common/configbase.h @@ -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, bool force = 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); From 097cc1e5b8ec01cbabfbae0f1ec863bd943de2b0 Mon Sep 17 00:00:00 2001 From: hello-stephen Date: Tue, 29 Nov 2022 15:25:26 +0800 Subject: [PATCH 3/3] fix --- be/src/common/configbase.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/be/src/common/configbase.cpp b/be/src/common/configbase.cpp index 70cbddc348f73d..bbce71e15f13d4 100644 --- a/be/src/common/configbase.cpp +++ b/be/src/common/configbase.cpp @@ -439,12 +439,12 @@ Status set_fuzzy_config(const std::string& field, const std::string& value) { void set_fuzzy_configs() { // random value true or false - Status s = set_fuzzy_config("enable_storage_vectorization", - ((rand() % 2) == 0) ? "true" : "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(); + // 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() {