Bug #67993 "innodb_log_files_in_group" and "innodb_log_file_size" is not changeable
Submitted: 30 Dec 2012 7:12 Modified: 2 Jan 2013 6:06
Reporter: Jackie Zhang Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S3 (Non-critical)
Version:5.5 OS:Any
Assigned to: CPU Architecture:Any

[30 Dec 2012 7:12] Jackie Zhang
Description:
Hi, I wanted to enlarge "innodb_log_files_in_group" from 2 (default) to 5. 

But when I started the server, I received the following errors:

InnoDB: Error: log file ./ib_logfile2 is of different size 0 0 bytes
InnoDB: than specified in the .cnf file 0 5242880 bytes!
121229 22:44:45 [ERROR] Plugin 'InnoDB' init function returned error.
121229 22:44:45 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
121229 22:44:45 [ERROR] Unknown/unsupported storage engine: InnoDB
121229 22:44:45 [ERROR] Aborting

Then I delete the ib_logfile2 (actually it's an empty file), and starts the server again, but I received the following errors:

121229 22:45:09  InnoDB: Log file ./ib_logfile2 did not exist: new to be created
121229 22:45:09 [ERROR] Plugin 'InnoDB' init function returned error.
121229 22:45:09 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
121229 22:45:09 [ERROR] Unknown/unsupported storage engine: InnoDB
121229 22:45:09 [ERROR] Aborting

so I touched a new ib_logfile2 in my data directory and restart mysqld, but I received the previous trace.

I searched the error message online and found a lot of users had very similar problem, but most of them had trouble with "innodb_log_file_size", e.g.,

http://www.onaxer.com/tag/error-plugin-innodb-init-function-returned-error/
http://vijaymodi.wordpress.com/2009/03/07/mysql-plugin-innodb-registration-as-a-storage-en...
http://forums.mysql.com/read.php?22,144428
http://manidba.wordpress.com/2011/08/31/mysql-plugin-innodb-registration-as-a-storage-engi...
https://groups.google.com/forum/?fromgroups=#!topic/comp.databases.mysql/jcSBfBbejZQ
http://sanchitbahal.wordpress.com/2011/07/21/mysql-installation-plugin-innodb-registration...
(and many many others!)

Following their solutions, I have to first manually clean all the old log files in the data directory, and then start the server. It works for me.

btw, I also have the same problem with "innodb_log_file_size" as them, but I guess these two share the same root cause.

I wonder whether it's caused by a bug? If it's not caused by a bug, I do suggest to make the process automatic or at least print out a more accurate message, considering so many mysql users are being confused by this problem.

Thanks a lot!

How to repeat:
Simply change the "innodb_log_files_in_group" in your configuration. For example, if you previously set 5, start the server with the follow arguments:

$ mysqld --innodb_log_files_in_group=10

Or, change "innodb_log_file_size" (which has the same symptom) like

$ mysqld --innodb_log_file_size=5000000

Suggested fix:
Either make the reconfiguration process automatic, i.e., move the old log files and create new ones, 

Or (if the above is too difficult), print out more accurate error messages (the current log message is really confusing.) like

"...ib_logfile2 is of different size XXX than what is configured XXX, 
please clean the log files in xxx/yyy/zzz and restart the system..."
[30 Dec 2012 7:26] MySQL Verification Team
Duplicate of http://bugs.mysql.com/bug.php?id=13494

This is fixed in 5.6.8 and higher.  The resizing of logfiles is automatically done.   Look:

[Warning] InnoDB: Resizing redo log from 5*3072 to 5*8192 pages, LSN=1945110
[Warning] InnoDB: Starting to delete and rewrite log files.
[Note] InnoDB: Setting log file .\ib_logfile101 size to 128 MB
InnoDB: Progress in MB: 100
[Note] InnoDB: Setting log file .\ib_logfile1 size to 128 MB
InnoDB: Progress in MB: 100
[Note] InnoDB: Setting log file .\ib_logfile2 size to 128 MB
InnoDB: Progress in MB: 100
[Note] InnoDB: Setting log file .\ib_logfile3 size to 128 MB
InnoDB: Progress in MB: 100
[Note] InnoDB: Setting log file .\ib_logfile4 size to 128 MB
InnoDB: Progress in MB: 100
[Note] InnoDB: Renaming log file .\ib_logfile101 to .\ib_logfile0
[Warning] InnoDB: New log files created, LSN=1945110

And:

[Warning] InnoDB: Resizing redo log from 2*3072 to 5*3072 pages, LSN=1944623
[Warning] InnoDB: Starting to delete and rewrite log files.
[Note] InnoDB: Setting log file .\ib_logfile101 size to 48 MB
[Note] InnoDB: Setting log file .\ib_logfile1 size to 48 MB
[Note] InnoDB: Setting log file .\ib_logfile2 size to 48 MB
[Note] InnoDB: Setting log file .\ib_logfile3 size to 48 MB
[Note] InnoDB: Setting log file .\ib_logfile4 size to 48 MB
[Note] InnoDB: Renaming log file .\ib_logfile101 to .\ib_logfile0
[Warning] InnoDB: New log files created, LSN=1944623
[2 Jan 2013 6:06] Jackie Zhang
Thanks for the confirmation, Shane!
But why not apply the patch on 5.5 which is the current GA release?

Happy new year!

--Jackie
[6 Mar 2013 13:07] Marko Mäkelä
5.6.10 is the current GA release. We cannot fix all bugs in GA releases due to the risk and effort involved. This one could theoretically be backported to earlier versions easily.