Bug #57190 Auto-resizing of the ib_logfile* files CancelOk
Submitted: 1 Oct 2010 22:08 Modified: 26 Nov 2012 19:02
Reporter: Tim Soderstrom Email Updates:
Status: Duplicate Impact on me:
Category:MySQL Server: InnoDB storage engine Severity:S4 (Feature request)
Version:5.1 OS:Any
Assigned to: CPU Architecture:Any
Tags: innodb, innodb_log_file_size
Triage: Needs Triage: D5 (Feature request)

[1 Oct 2010 22:08] Tim Soderstrom
Currently, to change the size of the InnoDB log_files, the server must be shutdown properly, logs removed, config changes, and the server started back up. It seems like InnoDB (or MySQL) could handle this automatically because the steps are actually quite mundane.

My thought is that InnoDB/MySQL could check the innodb.log-file-size variable and, if different than the size of the ib_logfile* files, simply copy the existing files elsewhere, generate the new logs, populate the new logs with the contents of the old files, then drop the old files. BOOM!

This makes the silent failure in cases where "innodb = FORCE" is not set and makes changing the logs a trivial process in general, avoiding confusion for those that are not familiar with the current process to do so.

How to repeat:
1. Set 'innodb_log_file_size' to something other than what the current file-size is
2. Restart MySQL
3. ???
4. Profit.

Suggested fix:
MySQL properly checks for when the innodb_log_file_size in the my.cnf is different than on disk does something like:

1. Rename exiting logs
2. Create new ib_logfiles
3. Copy data from old logs to new logs
4. Delete old logs
[25 Dec 2010 11:28] Valeriy Kravchuk
Thank you for the feature request. It makes some sense, but still manual intervention may be required when, for example, there is no free space on disk to copy old log files, or to create new ones after copying...
[26 Dec 2010 21:52] Tim Soderstrom
That is a system administration issue not a MySQL one. In such a case where, MySQL should simply fail to start since the logfiles could not be resized. In other words, poor system administration should not be a block for said feature request.
[2 Feb 2012 20:32] Jordi Clariana

I think this is really a good feature to be included in Mysql Server. I see it's a very old request, so: is there any intention to do this? I would really appreciate it.

[26 Nov 2012 19:02] Marko Mäkelä
This is a duplicate of Bug#13494 Log size differences create possibility of corruption. The fix is in MySQL 5.6.8.