WL#12360: Add an option to allow server quick settings validation.
Affects: Server-8.0 — Status: Complete
Prior to 8.0, 'mysqld --verbose --help' was used to verify whether the server configuration settings was valid. Running mysqld --verbose --help would result in an error if the configuration was invalid. For example: In 5.7: ./sql/mysqld --verbose --help --foo=bar To see what values a running MySQL server is using, type 'mysqladmin variables' instead of 'mysqld --verbose --help'. 2018-08-14T05:13:46.500953Z 0 [ERROR] Aborting In 8.0: ./runtime_output_directory/mysqld --verbose --help --foo=bar To see what values a running MySQL server is using, type 'mysqladmin variables' instead of 'mysqld --verbose --help'. As seen above there is no error reported in case of 8.0 Pasting the snippet from bug page: A proper option for validating the configuration would make it simpler for packaging, Docker images etc. to be able to quickly detect bad settings and inform users. Goal of WL ========== Introduce a command line/configuration option 'validate-config' which allows users to validate their server configuration settings.
a) A new server command line/config file option called "validate-config" to validate the server configuration settings provided during server start up. b) "validate-config" will be a special option with the sole purpose of validating the options supplied. Hence server start up, storage engines/plugins initialization will not be performed when this option is used. The "validate-config" option will validate only the server options(i.e the output of "--help --verbose") and does not validate plugin options. c) The server will exit with an error(error no 1) for first occurrence of invalid configuration. d) The server will exit with zero value(Success) when it has successfully validated all the configuration options. e) The server will exit with zero value while reporting warnings when invalid values are specified for valid server options when used with appropriate "log_error_verbosity" option value(except for storage engine and performance_schema options since they are not intitialized). f) Since the plugin initialization is not performed, when the plugin variables are used with "validate-config", the plugin variables will not be recognized and will be marked as unknown variables.
The new option called "validate-config" is especially useful after upgrade when validating if the upgraded server works with older configurations. Consider the following scenario where the option would be useful. Let us consider validating the server configuration containing 5.7 deprecated option "tx_read_only" which was removed in 8.0 release. Example: ./runtime_output_directory/mysqld --tx_read_only=on --validate-config 2018-08-30T10:40:02.712141Z 0 [ERROR] [MY-000067] [Server] unknown variable 'tx_read_only=on'. 2018-08-30T10:40:02.712178Z 0 [ERROR] [MY-010119] [Server] Aborting Also, this option can be used in the configuration file to evaluate the options specified in the config file. ./runtime_output_directory/mysqld --defaults-file=/home/nisha/workspace1/mysql-12360/dbg-trunk/my.cnf 2018-09-07T06:23:31.411188Z 0 [ERROR] [MY-000067] [Server] unknown variable 'tx_read_only=1'. 2018-09-07T06:23:31.411250Z 0 [ERROR] [MY-010119] [Server] Aborting This option helps to quickly identify the invalid option without having to scan through the documentation to identify the invalid option.
Copyright (c) 2000, 2020, Oracle Corporation and/or its affiliates. All rights reserved.