@@ -1602,20 +1602,23 @@ void update_config(const std::string& field, const std::string& value) {
16021602 }
16031603}
16041604
1605- Status set_fuzzy_config (const std::string& field, const std::string& value) {
1606- LOG (INFO ) << fmt::format (" FUZZY MODE: {} has been set to {}" , field, value);
1607- return set_config (field, value, false , true );
1608- }
1609-
1610- void set_fuzzy_configs () {
1611- // random value true or false
1612- static_cast <void >(
1613- set_fuzzy_config (" disable_storage_page_cache" , ((rand () % 2 ) == 0 ) ? " true" : " false" ));
1614- static_cast <void >(
1615- set_fuzzy_config (" enable_system_metrics" , ((rand () % 2 ) == 0 ) ? " true" : " false" ));
1616- // random value from 8 to 48
1617- // s = set_fuzzy_config("doris_scanner_thread_pool_thread_num", std::to_string((rand() % 41) + 8));
1618- // LOG(INFO) << s.to_string();
1605+ Status set_fuzzy_configs () {
1606+ std::unordered_map<std::string, std::string> fuzzy_field_and_value;
1607+
1608+ // if have set enable_fuzzy_mode=true in be.conf, will fuzzy those field and values
1609+ fuzzy_field_and_value[" disable_storage_page_cache" ] = ((rand () % 2 ) == 0 ) ? " true" : " false" ;
1610+ fuzzy_field_and_value[" enable_system_metrics" ] = ((rand () % 2 ) == 0 ) ? " true" : " false" ;
1611+
1612+ fmt::memory_buffer buf;
1613+ for (auto it = fuzzy_field_and_value.begin (); it != fuzzy_field_and_value.end (); it++) {
1614+ const auto & field = it->first ;
1615+ const auto & value = it->second ;
1616+ RETURN_IF_ERROR (set_config (field, value, false , true ));
1617+ fmt::format_to (buf, " {}={}, " , field, value);
1618+ }
1619+ LOG (INFO ) << fmt::format (" FUZZY MODE IN BE: those variables have been changed: ({})." ,
1620+ fmt::to_string (buf));
1621+ return Status::OK ();
16191622}
16201623
16211624std::mutex* get_mutable_string_config_lock () {
0 commit comments