Description:
When setting innodb_log_buffer_size to values not equal to 1 in the option file (my.cnf), mysqld server fails to start with the following message:
121228 23:36:36 [ERROR] syntax error in innodb_log_group_home_dir, or a wrong number of mirrored log groups
121228 23:36:36 [ERROR] Plugin 'InnoDB' init function returned error.
121228 23:36:36 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
121228 23:36:36 [ERROR] Unknown/unsupported storage engine: InnoDB
121228 23:36:36 [ERROR] Aborting
It seems to me that the following code causes the error:
/* storage/innobase/handler/ha_innodb.cc */
2383 if (ret == FALSE || innobase_mirrored_log_groups != 1) {
2384 sql_print_error("syntax error in innodb_log_group_home_dir, or a "
2385 "wrong number of mirrored log groups");
2386
2387 goto mem_free_and_error;
2388 }
If the other values of "innobase_mirrored_log_groups" is not allowed, why we still allow such setting which causes problems and confusion?
I suggest to simply restrict the data range of the value to [1, 1] to adjust other settings to the valid one. See the patch attached.
Thanks!
How to repeat:
Set the following configuration line in the closest my.cnf
innodb_log_buffer_size = 10
and start the mysqld server.
Suggested fix:
Simply restrict the data range of "innodb_log_buffer_size" to [1,1] can solve the problem. The patch is referred below:
-- storage/innobase/handler/ha_innodb.cc 2012-12-28 23:47:00.931127451 -0800
+++ storage/innobase/handler/ha_innodb.cc 2012-12-28 23:47:25.721143061 -0800
@@ -11561,7 +11561,7 @@
static MYSQL_SYSVAR_LONG(mirrored_log_groups, innobase_mirrored_log_groups,
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
"Number of identical copies of log groups we keep for the database. Currently this should be set to 1.",
- NULL, NULL, 1, 1, 10, 0);
+ NULL, NULL, 1, 1, 1, 0);
static MYSQL_SYSVAR_UINT(old_blocks_pct, innobase_old_blocks_pct,
PLUGIN_VAR_RQCMDARG,