Bug #40423 mysqld_safe loops forever if server is started with wrong --innodb-log-file-size
Submitted: 30 Oct 2008 10:43 Modified: 11 Nov 2008 22:15
Reporter: Bernt Marius Johnsen Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: General Severity:S1 (Critical)
Version:6.0 OS:Linux
Assigned to:

[30 Oct 2008 10:43] Bernt Marius Johnsen
Description:
Server is started first time with --innodb-buffer-pool-size=3GB --innodb-log-file-size=1G. After shutdown and restart with defaults (no options) it will not register innodb, this goes then on forever. 

Log file:

081030 11:22:45 mysqld_safe Starting mysqld daemon with databases from /export/home2/tmp/database
InnoDB: The first specified data file ./ibdata1 did not exist:
InnoDB: a new database to be created!
081030 11:22:45  InnoDB: Setting file ./ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
081030 11:22:46  InnoDB: Log file ./ib_logfile0 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile0 size to 1024 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Progress in MB: 100 200 300 400 500 600 700 800 900 1000
081030 11:23:07  InnoDB: Log file ./ib_logfile1 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile1 size to 1024 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Progress in MB: 100 200 300 400 500 600 700 800 900 1000
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
081030 11:23:29  InnoDB: Started; log sequence number 0 0
081030 11:23:29 [Note] Event Scheduler: Loaded 0 events
081030 11:23:29 [Note] /export/home/tmp/install/mysql-6.0/libexec/mysqld: ready for connections.
Version: '6.0.8-alpha'  socket: '/tmp/mysql.sock'  port: 3306  Source distribution
081030 11:23:39 [Note] /export/home/tmp/install/mysql-6.0/libexec/mysqld: Normal shutdown

081030 11:23:39 [Note] Event Scheduler: Purging the queue. 0 events
081030 11:23:39  InnoDB: Starting shutdown...
081030 11:23:41  InnoDB: Shutdown completed; log sequence number 0 46409
081030 11:23:42 [Note] /export/home/tmp/install/mysql-6.0/libexec/mysqld: Shutdown complete

081030 11:23:42 mysqld_safe mysqld from pid file /export/home2/tmp/database/nanna20.pid ended
081030 11:23:48 mysqld_safe Starting mysqld daemon with databases from /export/home2/tmp/database
InnoDB: Error: log file ./ib_logfile0 is of different size 0 1073741824 bytes
InnoDB: than specified in the .cnf file 0 5242880 bytes!
081030 11:23:48 [ERROR] Plugin 'InnoDB' init function returned error.
081030 11:23:48 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
/export/home/tmp/install/mysql-6.0/libexec/mysqld(my_print_stacktrace+0x35)[0xb75e35]
/export/home/tmp/install/mysql-6.0/libexec/mysqld(handle_segfault+0x336)[0x694416]
/lib64/libpthread.so.0[0x335180de70]
/export/home/tmp/install/mysql-6.0/libexec/mysqld(_Z11plugin_lockP3THDPP13st_plugin_int+0x27)[0x813d27]
/export/home/tmp/install/mysql-6.0/libexec/mysqld(_Z12ha_checktypeP3THD14legacy_db_typebb+0x5a)[0x7929ba]
/export/home/tmp/install/mysql-6.0/libexec/mysqld(_Z14open_table_defP3THDP11TABLE_SHAREj+0x9f9)[0x6f2589]
/export/home/tmp/install/mysql-6.0/libexec/mysqld(_Z15get_table_shareP3THDP10TABLE_LISTPcjjPi+0x17f)[0x6e1fbf]
/export/home/tmp/install/mysql-6.0/libexec/mysqld[0x6e3d44]
/export/home/tmp/install/mysql-6.0/libexec/mysqld(_Z10open_tableP3THDP10TABLE_LISTP11st_mem_rootP22enum_open_table_actionj+0x7d0)[0x6e8f70]
/export/home/tmp/install/mysql-6.0/libexec/mysqld(_Z11open_tablesP3THDPP10TABLE_LISTPjj+0x30b)[0x6ea61b]
/export/home/tmp/install/mysql-6.0/libexec/mysqld(_Z28open_and_lock_tables_derivedP3THDP10TABLE_LISTbj+0x41)[0x6eac61]
/export/home/tmp/install/mysql-6.0/libexec/mysqld(_Z10acl_reloadP3THD+0x12a)[0x74bbca]
/export/home/tmp/install/mysql-6.0/libexec/mysqld(_Z8acl_initb+0xcf)[0x74d0ef]
/export/home/tmp/install/mysql-6.0/libexec/mysqld(main+0x550)[0x699620]
/lib64/libc.so.6(__libc_start_main+0xf4)[0x3350c1d8b4]
/export/home/tmp/install/mysql-6.0/libexec/mysqld(__gxx_personality_v0+0x2d1)[0x5c1c19]
081030 11:23:48 - mysqld got signal 11 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help diagnose
the problem, but since we have already crashed, something is definitely wrong
and this may fail.

key_buffer_size=8388600
read_buffer_size=131072
max_used_connections=0
max_threads=151
thread_count=0
connection_count=0
It is possible that mysqld could use up to 
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 338367 K
bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

thd: 0x2aaab000cc20
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 0x7fff982822d8 thread_stack 0x40000
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort...
thd->query at (nil) is an invalid pointer
thd->thread_id=0
thd->killed=NOT_KILLED
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.
081030 11:23:48 mysqld_safe Number of processes running now: 0
081030 11:23:48 mysqld_safe mysqld restarted
InnoDB: Error: log file ./ib_logfile0 is of different size 0 1073741824 bytes
InnoDB: than specified in the .cnf file 0 5242880 bytes!
081030 11:23:48 [ERROR] Plugin 'InnoDB' init function returned error.
081030 11:23:48 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
/export/home/tmp/install/mysql-6.0/libexec/mysqld(my_print_stacktrace+0x35)[0xb75e35]
/export/home/tmp/install/mysql-6.0/libexec/mysqld(handle_segfault+0x336)[0x694416]
/lib64/libpthread.so.0[0x335180de70]
/export/home/tmp/install/mysql-6.0/libexec/mysqld(_Z11plugin_lockP3THDPP13st_plugin_int+0x27)[0x813d27]
/export/home/tmp/install/mysql-6.0/libexec/mysqld(_Z12ha_checktypeP3THD14legacy_db_typebb+0x5a)[0x7929ba]
/export/home/tmp/install/mysql-6.0/libexec/mysqld(_Z14open_table_defP3THDP11TABLE_SHAREj+0x9f9)[0x6f2589]
/export/home/tmp/install/mysql-6.0/libexec/mysqld(_Z15get_table_shareP3THDP10TABLE_LISTPcjjPi+0x17f)[0x6e1fbf]
/export/home/tmp/install/mysql-6.0/libexec/mysqld[0x6e3d44]
/export/home/tmp/install/mysql-6.0/libexec/mysqld(_Z10open_tableP3THDP10TABLE_LISTP11st_mem_rootP22enum_open_table_actionj+0x7d0)[0x6e8f70]
/export/home/tmp/install/mysql-6.0/libexec/mysqld(_Z11open_tablesP3THDPP10TABLE_LISTPjj+0x30b)[0x6ea61b]
/export/home/tmp/install/mysql-6.0/libexec/mysqld(_Z28open_and_lock_tables_derivedP3THDP10TABLE_LISTbj+0x41)[0x6eac61]
/export/home/tmp/install/mysql-6.0/libexec/mysqld(_Z10acl_reloadP3THD+0x12a)[0x74bbca]
/export/home/tmp/install/mysql-6.0/libexec/mysqld(_Z8acl_initb+0xcf)[0x74d0ef]
/export/home/tmp/install/mysql-6.0/libexec/mysqld(main+0x550)[0x699620]
/lib64/libc.so.6(__libc_start_main+0xf4)[0x3350c1d8b4]
/export/home/tmp/install/mysql-6.0/libexec/mysqld(__gxx_personality_v0+0x2d1)[0x5c1c19]
081030 11:23:48 - mysqld got signal 11 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help diagnose
the problem, but since we have already crashed, something is definitely wrong
and this may fail.

How to repeat:
Start server first time with

mysqld_safe --innodb-buffer-pool-size=3GB --innodb-log-file-size=1G

then shut it down and start server with no options.
[30 Oct 2008 14:14] Mikhail Izioumtchenko
This is not a bug, however I couldn't mention anything in the documentation (5.1 ref manual)about changing innodb-log-file-size not being supported.
This isn't plugin specific, either, it's common for both plugin and builtin InnoDB. 
It works like this:
you should be able to change innodb-buffer-pool-size at will, restarting the server of course
innodb-log-file-size is a different matter, however. The log files are initialized as part of the database initialization and their size cannot be changed, nor a different size can be specified at startup time. The reason for the latter is that we check the innodb-log-file-size against the actual log file size to detect data corruption i.e. log file being inadvertently truncated.

Putting this to 'need doc' state, since it would be a good idea to document that we can't change the log file size once it's been initialized.
[30 Oct 2008 14:16] Mikhail Izioumtchenko
Bernt, in your particular case you have to burn --innodb-log-file-size=1G to your my.cnf or your mysqld startup script. the buffer pool size you should be able to change at will.
[30 Oct 2008 14:26] Heikki Tuuri
http://dev.mysql.com/doc/refman/5.1/en/adding-and-removing.html

Maybe the title should be: Adding and removing and RESIZING InnoDB data and log files?
[30 Oct 2008 14:29] Heikki Tuuri
Please also add boldface or a subsection to highlight the instructions for LOG FILES.
[30 Oct 2008 14:33] Mikhail Izioumtchenko
so, it IS possible to change the log file size without reinitializing the database as a whole, please see the section of the manual Heikki refers to.
Still, as soon as the log files are initialized to a non-default size, you have to put thatsize to your my.cnf or mysqld startup script.
[30 Oct 2008 19:16] Paul Dubois
Changed section title to reflect that it contains resizing instructions.
[31 Oct 2008 13:12] Bernt Marius Johnsen
Thanks for all the replies. Anyway, it should be considered a bug that the mysqld_safe script loops forever trying to start the server instead of terminating with an reasonable error message.

Also, it would be a much better user experience if an already existing log file is used when --innodb-log-file-size is not specified.
[4 Nov 2008 13:24] Bernt Marius Johnsen
Since mysqld_safe loops forever instead of, I frankly believe that this bug should not be closed. Reopened, changed synopsis and category.
[11 Nov 2008 22:15] Sveta Smirnova
Thank you for the feedback.

This is actually duplicate of bug #34084
[4 Oct 2012 7:10] Marko Mäkelä
The log file size problem is Bug#13494.