Bug #67988 Startup error when innodb_mirrored_log_groups != 1
Submitted: 29 Dec 2012 7:54 Modified: 29 Dec 2012 16:28
Reporter: Tianyin Xu Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S3 (Non-critical)
Version:mysql-5.5.28 OS:Any
Assigned to: CPU Architecture:Any

[29 Dec 2012 7:54] Tianyin Xu
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,
[29 Dec 2012 7:56] Tianyin Xu
patch to restrict the data range

Attachment: my.mirrored_log_groups.patch (text/x-patch), 561 bytes.

[29 Dec 2012 11:48] Valeriy Kravchuk
Looks like a duplicate of bug #67670.
[29 Dec 2012 16:28] Erlend Dahl
It is indeed a duplicate of Bug #67670 	Setting innodb_mirrored_log_groups = 2 leads to server crash.

A fix for this is scheduled for an upcoming point release of 5.1/5.5/5.6.