MySQL daemon keeps dying and restarting when using ssl connections
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MySQL Server |
Unknown
|
Unknown
|
|||
mysql-5.1 (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Lucid |
Fix Released
|
High
|
Unassigned |
Bug Description
[Impact]
After running thousands of mysql queries on lucid, the mysql daemon terminates with status 1. This can impact anybody doing a large number of transactions on a system.
[Development Fix]
Backporting mysql from maverick (5.1.49) to lucid solves the issue. An effort was made to backport specific patches from maverick to lucid, but the issue was unable to be resolved.
[Stable Fix]
In order to fix this bug, a backport is requested from maverick to lucid.
[Test Case]
1. Install Lucid + updates + LAMP stack
2. Configure MySQL + SSL
3. Create SSL certificates and configure the mysql client and server to use the certificates: http://
Add ssl options to /etc/mysql/my.cnf on the Server:
In the section [mysql] add:
ssl-ca=
ssl-cert=
ssl-key=
On the client:
In the section [client] add:
ssl-ca=
ssl-cert=
ssl-key=
4. Test the SSL connection using mysql command line:
# mysql --ssl -p
show variables like “%ssl%” (value should be “YES” for “have_openssl”)
\s (output should include “SSL: Cipher in use is....”)
5. Force the mysql user account for the database driven website to use SSL:
update user set ssl_type=’X509’ where user=’USERNAME’; flush privileges;
6. Bang the server using ab with a client script like the one below
ab
lborda@
<?php
error_reporting
ini_set(
$obj = mysqli_init();
mysqli_
mysqli_ssl_set( $obj,
$link = mysqli_
if (!$link)
{
die('<br /><br />Connect Error (' . mysqli_
}
echo 'Success... ' . mysqli_
$obj->close();
?>
[Regression Potential]
There is potential since this is a backport.
--
On a server dedicated as a MySQL database server, MySQL keeps randomly "terminating with status 1" (from /var/log/
MySQL-Server version 5.1.49 seems to include the fix as per this bug entry: http://
Here are some timestamps from daemon.log from when Mysql terminated:
Jul 4 12:53:28 lightning init: mysql main process (9796) terminated with status 1
Jul 4 22:28:31 lightning init: mysql main process (8123) terminated with status 1
Jul 5 04:03:13 lightning init: mysql main process (20731) terminated with status 1
MySQL Error logs describe the following stack trace. probably due to the use of yaSSL when configuring mysql to use ssl.
http://
*** PS: The server uses SSL connections through MySQL ***
110721 11:17:02 - mysqld got signal 11 ;
key_buffer_
read_buffer_
max_used_
max_threads=151
threads_connected=2
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_
bytes of memory
Hope that's ok; if not, decrease some variables in the equation.
thd: 0x7f1d3406c780
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 = 0x7f1d3be68e58 thread_stack 0x30000
/usr/sbin/
/usr/sbin/
/lib/libpthread
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/lib/libpthread
/lib/libc.
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_
thd->killed=
The manual page at http://
information that should help you find out what is causing the crash.
110721 11:17:02 [Note] Plugin 'FEDERATED' is disabled.
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
110721 11:17:02 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
Package information:
ii mysql-server 5.1.41-3ubuntu12.10 MySQL database server (metapackage depending
ii mysql-server-5.1 5.1.41-3ubuntu12.10 MySQL database server binaries
ii mysql-server-
Reproducible: No, it is a random behaviour. It happens after running thousands of queries...
Changed in mysql-5.1 (Ubuntu): | |
status: | New → Confirmed |
Changed in mysql-5.1 (Ubuntu Lucid): | |
status: | New → Confirmed |
importance: | Undecided → High |
Changed in mysql-5.1 (Ubuntu): | |
importance: | Undecided → High |
assignee: | nobody → Ubuntu Server Team (ubuntu-server) |
assignee: | Ubuntu Server Team (ubuntu-server) → nobody |
status: | Confirmed → Invalid |
importance: | High → Undecided |
Changed in mysql-5.1 (Ubuntu Lucid): | |
milestone: | none → lucid-updates |
Changed in mysql-5.1 (Ubuntu Lucid): | |
assignee: | nobody → Chris J Arges (christopherarges) |
description: | updated |
Changed in mysql-5.1 (Ubuntu): | |
status: | Invalid → Confirmed |
Changed in mysql-5.1 (Ubuntu Lucid): | |
assignee: | Chris J Arges (christopherarges) → nobody |
status: | Fix Committed → Fix Released |
Changed in mysql-5.1 (Ubuntu): | |
status: | Confirmed → Fix Released |
Update,
Updating Ubuntu Lucid to Maverick fixes the issue. So the problem is between Lucid and Maverick versions.
Going through the introduced patches will help fix the issue.
The version the fixes the problem is the following: ca.archive. ubuntu. com/ubuntu/ maverick- updates/ main amd64 Packages security. ubuntu. com/ubuntu/ maverick- security/ main amd64 Packages dpkg/status 1.49-1ubuntu8 0 ca.archive. ubuntu. com/ubuntu/ maverick/main amd64 Packages
mysql-server:
Installed: 5.1.49-1ubuntu8.1
Candidate: 5.1.49-1ubuntu8.1
Version table:
*** 5.1.49-1ubuntu8.1 0
500 http://
500 http://
100 /var/lib/
5.
500 http://
Leonardo