Merge branch '2.3' into develop
This commit is contained in:
@ -1133,6 +1133,7 @@ static bool config_load_and_process(const char* filename, bool (* process_config
|
||||
{
|
||||
bool rval = false;
|
||||
DUPLICATE_CONTEXT dcontext;
|
||||
bool have_persisted_configs = false;
|
||||
|
||||
if (duplicate_context_init(&dcontext))
|
||||
{
|
||||
@ -1166,8 +1167,12 @@ static bool config_load_and_process(const char* filename, bool (* process_config
|
||||
* TODO: Figure out a cleaner way to do this
|
||||
*/
|
||||
is_persisted_config = true;
|
||||
have_persisted_configs = true;
|
||||
|
||||
MXS_NOTICE("Loading generated configuration files from '%s'", persist_cnf);
|
||||
MXS_NOTICE("Runtime configuration changes have been done to MaxScale. Loading persisted "
|
||||
"configuration files and applying them on top of the main configuration file. "
|
||||
"These changes can override the values of the main configuration file: "
|
||||
"To revert them, remove all the files in '%s'.", persist_cnf);
|
||||
DUPLICATE_CONTEXT p_dcontext;
|
||||
/**
|
||||
* We need to initialize a second duplicate context for the
|
||||
@ -1193,12 +1198,12 @@ static bool config_load_and_process(const char* filename, bool (* process_config
|
||||
if (!check_config_objects(config_context.next) || !process_config(config_context.next))
|
||||
{
|
||||
rval = false;
|
||||
if (contains_cnf_files(persist_cnf))
|
||||
if (have_persisted_configs)
|
||||
{
|
||||
MXS_WARNING("One or more generated configurations were found at '%s'. "
|
||||
"If the error relates to any of the files located there, "
|
||||
"remove the offending configurations from this directory.",
|
||||
persist_cnf);
|
||||
MXS_WARNING("Persisted configuration files generated by runtime configuration "
|
||||
"changes were found at '%s' and at least one configuration error was "
|
||||
"encountered. If the errors relate to any of the persisted configuration "
|
||||
"files, remove the offending files and restart MaxScale.", persist_cnf);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2632,6 +2637,38 @@ static int handle_global_item(const char* name, const char* value)
|
||||
return processed ? 1 : 0;
|
||||
}
|
||||
|
||||
bool config_can_modify_at_runtime(const char* name)
|
||||
{
|
||||
for (int i = 0; config_pre_parse_global_params[i]; ++i)
|
||||
{
|
||||
if (strcmp(name, config_pre_parse_global_params[i]) == 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
std::unordered_set<std::string> static_params
|
||||
{
|
||||
CN_USERS_REFRESH_TIME,
|
||||
CN_LOCAL_ADDRESS,
|
||||
CN_ADMIN_ENABLED,
|
||||
CN_ADMIN_SSL_CA_CERT,
|
||||
CN_ADMIN_SSL_CERT,
|
||||
CN_ADMIN_SSL_KEY,
|
||||
CN_ADMIN_HOST,
|
||||
CN_ADMIN_PORT,
|
||||
CN_LOG_THROTTLING,
|
||||
"sql_mode",
|
||||
CN_QUERY_CLASSIFIER_ARGS,
|
||||
CN_QUERY_CLASSIFIER,
|
||||
CN_POLL_SLEEP,
|
||||
CN_NON_BLOCKING_POLLS,
|
||||
CN_THREAD_STACK_SIZE,
|
||||
CN_THREADS
|
||||
};
|
||||
|
||||
return static_params.count(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Free an SSL structure
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user