One of my databases has been shutting down abnormally, but the log said "normal":
130422 13:23:01 [Note] /usr/libexec/mysqld: Normal shutdown 130422 13:23:01 [Note] Event Scheduler: Killing the scheduler thread, thread id 379021 130422 13:23:01 [Note] Event Scheduler: Waiting for the scheduler thread to reply 130422 13:23:01 [Note] Event Scheduler: Stopped 130422 13:23:01 [Note] Event Scheduler: Purging the queue. 41 events 130422 13:23:01 [Note] Error reading relay log event: slave SQL thread was killed 130422 13:23:01 [ERROR] Error reading packet from server: Lost connection to MySQL server during query ( server_errno=2013) 130422 13:23:01 [Note] Slave I/O thread killed while reading event 130422 13:23:01 [Note] Slave I/O thread exiting, read up to log 'mysql-bin.002426', position 107 ... 130422 13:23:04 InnoDB: Starting shutdown... 130422 13:23:04 InnoDB: Waiting for 201 pages to be flushed 130422 13:23:08 InnoDB: Shutdown completed; log sequence number 6942784551767 130422 13:23:08 [Note] /usr/libexec/mysqld: Shutdown complete
There is no related error or stack trace in the
mysqld.log, just some errors:
No data - zero rows fetched, selected, or processed
from Event Scheduler.
I'm pretty sure my team doesn't stop it (via init script or
mysqladmin shutdown, ...).
grep through the last binlog file, I didn't see any
Is there any other causes? Let me know if you need more information.
PS: mysql Ver 14.14 Distrib 5.5.28, for Linux (x86_64) using readline 5.1
UPDATE at Mon Apr 22 18:23:33 ICT 2013
Searching through the source code, I found this:
$ grep -lir 'normal shutdown' mysql-5.5.28 mysql-5.5.28/scripts/mysqld_safe.sh mysql-5.5.28/Docs/mysql.info mysql-5.5.28/sql/share/errmsg-utf8.txt $ grep -lr 'ER_NORMAL_SHUTDOWN' mysql-5.5.28 mysql-5.5.28/Docs/mysql.info mysql-5.5.28/sql/mysqld.cc mysql-5.5.28/sql/share/errmsg-utf8.txt
if (sig != 0) // 0 is not a valid signal number my_sigset(sig, SIG_IGN); /* purify inspected */ if (sig == MYSQL_KILL_SIGNAL || sig == 0) sql_print_information(ER_DEFAULT(ER_NORMAL_SHUTDOWN),my_progname); else sql_print_error(ER_DEFAULT(ER_GOT_SIGNAL),my_progname,sig); /* purecov: inspected */
Looks like that there is no other reason for this message can be logged into the log file. One possibility I'm thinking is someone (who has
SUPER privilege) turned off the binary log then run
SHUTDOWN and close the db connection.
PS: In this bug report, there is one person also got this problem on 5.5.24.