Skip to content

Commit ca0aa69

Browse files
author
Tatiana Azundris Nuernberg
committed
Bug#31410674: RESTORE SET PERSISTED LOG_ERROR_VERBOSITY IN TIME TO AFFECT INNODB SET-UP
During start-up, the order is roughly, - read .cnf files - read SET PERSISTed system variables - restore "read-only_ persists by appending them to the command-line - parse "early" command-line options (handle_early_options()) - init many things (incl. error log) - parse "regular" command-line options (get_options()) - init server components (open error log, init InnoDB, init DD, read auto.cnf, ...) - component infrastructure (as dependent on InnoDB for its config) - restore "regular" PERSISTs by emulating SET GLOBAL ... - engage loadable logging components ... This means that if setting log_error_verbosity on the command-line, the new value will be set and become active before InnoDB starts. However if log_error_verbosity is PERSISTed, it is restored as a "regular_ persisted sys-var, and therefore only after InnoDB has started. As a result, its value will not be used to filter InnoDB's start-up messages. Fix: Tagging the sys-var, log_error_verbosity, as PERSIST_AS_READONLY results in the persisted value being restored via the command-line. This way, a) the value will be set before InnoDB starts up, so InnoDB's messages will be filtered using the desired verbosity; b) the log_error_verbosity's behaviour when using SET PERSIST is more in line with its behaviour when setting the value from the command-line. Patch flags log_error_suppression_list in the same way. As it is an option for filtering error-log messages that affects the same filter (log_filter_internal), it should be applied at the same time to avoid surprises. Approved by: Jens Even Blomsoy <[email protected]>
1 parent f94c382 commit ca0aa69

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

sql/sys_vars.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2466,9 +2466,9 @@ static Sys_var_charptr Sys_log_error_suppression_list(
24662466
"or Error severity will always be included. Requires the filter "
24672467
"\'log_filter_internal\' to be set in @@global.log_error_services, which "
24682468
"is the default.",
2469-
GLOBAL_VAR(opt_log_error_suppression_list), CMD_LINE(REQUIRED_ARG),
2470-
IN_SYSTEM_CHARSET, DEFAULT(""), NO_MUTEX_GUARD, NOT_IN_BINLOG,
2471-
ON_CHECK(check_log_error_suppression_list),
2469+
PERSIST_AS_READONLY GLOBAL_VAR(opt_log_error_suppression_list),
2470+
CMD_LINE(REQUIRED_ARG), IN_SYSTEM_CHARSET, DEFAULT(""), NO_MUTEX_GUARD,
2471+
NOT_IN_BINLOG, ON_CHECK(check_log_error_suppression_list),
24722472
ON_UPDATE(fix_log_error_suppression_list));
24732473

24742474
static Sys_var_bool Sys_log_queries_not_using_indexes(
@@ -2523,9 +2523,9 @@ static Sys_var_ulong Sys_log_error_verbosity(
25232523
"2, log errors and warnings. "
25242524
"3, log errors, warnings, and notes. "
25252525
"Messages sent to the client are unaffected by this setting.",
2526-
GLOBAL_VAR(log_error_verbosity), CMD_LINE(REQUIRED_ARG), VALID_RANGE(1, 3),
2527-
DEFAULT(2), BLOCK_SIZE(1), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(nullptr),
2528-
ON_UPDATE(update_log_error_verbosity));
2526+
PERSIST_AS_READONLY GLOBAL_VAR(log_error_verbosity), CMD_LINE(REQUIRED_ARG),
2527+
VALID_RANGE(1, 3), DEFAULT(2), BLOCK_SIZE(1), NO_MUTEX_GUARD, NOT_IN_BINLOG,
2528+
ON_CHECK(nullptr), ON_UPDATE(update_log_error_verbosity));
25292529

25302530
static Sys_var_enum Sys_log_timestamps(
25312531
"log_timestamps",

0 commit comments

Comments
 (0)