Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions be/src/common/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
19 changes: 17 additions & 2 deletions be/src/common/configbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -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;
}
Expand Down
7 changes: 6 additions & 1 deletion be/src/common/configbase.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,13 +174,18 @@ 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);

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
5 changes: 5 additions & 0 deletions be/src/service/doris_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down