2023-02-18 04:46:09 +00:00
|
|
|
#include "ServerSettings.h"
|
|
|
|
#include <Poco/Util/AbstractConfiguration.h>
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
IMPLEMENT_SETTINGS_TRAITS(ServerSettingsTraits, SERVER_SETTINGS)
|
|
|
|
|
|
|
|
void ServerSettings::loadSettingsFromConfig(const Poco::Util::AbstractConfiguration & config)
|
|
|
|
{
|
Refactor reading the pool setting & from server config. (#48055)
After #36425 there was a lot of confusions/problems with configuring pools - when the message was confusing, and settings need to be ajusted in several places.
See some examples in #44251, #43351, #47900, #46515.
The commit includes the following changes:
1) Introduced a unified mechanism for reading pool sizes from the configuration file(s). Previously, pool sizes were read from the Context.cpp with fallbacks to profiles, whereas main_config_reloader in Server.cpp read them directly without fallbacks.
2) Corrected the data type for background_merges_mutations_concurrency_ratio. It should be float instead of int.
3) Refactored the default values for settings. Previously, they were defined in multiple places throughout the codebase, but they are now defined in one place (or two, to be exact: Settings.h and ServerSettings.h).
4) Improved documentation, including the correct message in system.settings.
Additionally make the code more conform with #46550.
2023-03-30 14:44:11 +00:00
|
|
|
// settings which can be loaded from the the default profile, see also MAKE_DEPRECATED_BY_SERVER_CONFIG in src/Core/Settings.h
|
|
|
|
std::unordered_set<std::string> settings_from_profile_allowlist = {
|
|
|
|
"background_pool_size",
|
|
|
|
"background_merges_mutations_concurrency_ratio",
|
|
|
|
"background_merges_mutations_scheduling_policy",
|
|
|
|
"background_move_pool_size",
|
|
|
|
"background_fetches_pool_size",
|
|
|
|
"background_common_pool_size",
|
|
|
|
"background_buffer_flush_schedule_pool_size",
|
|
|
|
"background_schedule_pool_size",
|
|
|
|
"background_message_broker_schedule_pool_size",
|
2023-04-03 12:52:47 +00:00
|
|
|
"background_distributed_schedule_pool_size",
|
|
|
|
|
|
|
|
"max_remote_read_network_bandwidth_for_server",
|
|
|
|
"max_remote_write_network_bandwidth_for_server",
|
Refactor reading the pool setting & from server config. (#48055)
After #36425 there was a lot of confusions/problems with configuring pools - when the message was confusing, and settings need to be ajusted in several places.
See some examples in #44251, #43351, #47900, #46515.
The commit includes the following changes:
1) Introduced a unified mechanism for reading pool sizes from the configuration file(s). Previously, pool sizes were read from the Context.cpp with fallbacks to profiles, whereas main_config_reloader in Server.cpp read them directly without fallbacks.
2) Corrected the data type for background_merges_mutations_concurrency_ratio. It should be float instead of int.
3) Refactored the default values for settings. Previously, they were defined in multiple places throughout the codebase, but they are now defined in one place (or two, to be exact: Settings.h and ServerSettings.h).
4) Improved documentation, including the correct message in system.settings.
Additionally make the code more conform with #46550.
2023-03-30 14:44:11 +00:00
|
|
|
};
|
|
|
|
|
2023-02-18 04:46:09 +00:00
|
|
|
for (auto setting : all())
|
|
|
|
{
|
|
|
|
const auto & name = setting.getName();
|
|
|
|
if (config.has(name))
|
|
|
|
set(name, config.getString(name));
|
Refactor reading the pool setting & from server config. (#48055)
After #36425 there was a lot of confusions/problems with configuring pools - when the message was confusing, and settings need to be ajusted in several places.
See some examples in #44251, #43351, #47900, #46515.
The commit includes the following changes:
1) Introduced a unified mechanism for reading pool sizes from the configuration file(s). Previously, pool sizes were read from the Context.cpp with fallbacks to profiles, whereas main_config_reloader in Server.cpp read them directly without fallbacks.
2) Corrected the data type for background_merges_mutations_concurrency_ratio. It should be float instead of int.
3) Refactored the default values for settings. Previously, they were defined in multiple places throughout the codebase, but they are now defined in one place (or two, to be exact: Settings.h and ServerSettings.h).
4) Improved documentation, including the correct message in system.settings.
Additionally make the code more conform with #46550.
2023-03-30 14:44:11 +00:00
|
|
|
else if (settings_from_profile_allowlist.contains(name) && config.has("profiles.default." + name))
|
|
|
|
set(name, config.getString("profiles.default." + name));
|
2023-02-18 04:46:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|