Bug #57335 | abnormal termination of the backup process could leave the global lock active | ||
---|---|---|---|
Submitted: | 8 Oct 2010 6:35 | Modified: | 28 Jan 2011 18:42 |
Reporter: | Victor Kirkebo | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Enterprise Backup | Severity: | S3 (Non-critical) |
Version: | 3.5.2 | OS: | Any |
Assigned to: | Satya B | CPU Architecture: | Any |
[8 Oct 2010 6:35]
Victor Kirkebo
[11 Oct 2010 10:49]
Susanne Ebrecht
Is it reproducable?
[11 Oct 2010 11:17]
Victor Kirkebo
I order to reproduce this: 1) I started a database and with a client session I locked one table. 2) Then I started a backup and with a client I checked the processlist until I saw that the command FLUSH TABLES WITH READ LOCK appeared in the state "Waiting for global metadata lock" (5.5) or "Waiting for global read lock" (5.1). The backup will wait in this state because I locked one table in 1). 3) I killed the backup processes (mysqlbackup and ibbackup). 4) I checked the processlist and saw that FLUSH TABLES WITH READ LOCK was still waiting to get the global read lock even if the backup process had been killed. 5) I also saw other clients waiting now waiting in the state "Waiting for release of readlock" because of "FLUSH TABLES WITH READ LOCK". In order to fix the problem I simply had to unlock the table that I locked in 1) above. However, I think it would be much better if the whole "FLUSH TABLES WITH READ LOCK" went away by itself when the backup process was killed but maybe this is not possible to get done from a client such as mysqlbackup.
[12 Oct 2010 6:46]
Satya B
when Innobackup perl is killed, which in turn kills the mysql client. mysql client has signal handler which sends KILL QUERY before exiting. With Innobackup C port (mysqlbackup), we use mysql c api not the mysql client binary. So the handling of signals should be done manually.
[12 Oct 2010 12:13]
Satya B
this is what mysql client does: mysql> FLUSH TABLES WITH READ LOCK; ^CCtrl-C -- sending "KILL QUERY 10" to server ... Ctrl-C -- query aborted. ERROR 1317 (70100): Query execution was interrupted mysql>
[15 Oct 2010 11:26]
Satya B
revno: 247 revision-id: satya.bn@sun.com-20101015112113-zw6up1nnhaq8hf46
[15 Oct 2010 11:29]
Satya B
Notes to Doc: Please Document this. If kill -9 used to kill the mysqlbackup process, the user has manually check for the 'FLUSH TABLES WITH READ LOCK' query and should do 'UNLOCK TABLES' using the mysql client.
[15 Oct 2010 11:35]
Satya B
Sorry, UNLOCK TABLES will not have any effect, since it is not from the same connection which has issued 'FTWRL'. KILL QUERY should be used to kill the 'FTWRL' query. Please rephrase the above statements a bit :)
[28 Jan 2011 18:42]
John Russell
Added to 3.5.2 manual: If the mysqlbackup process is interrupted, such as by a Unix kill -9 command, a FLUSH TABLES WITH READ LOCK operation might remain running. In this case, use the KILL QUERY command from the mysql command line to kill the FLUSH TABLES WITH READ LOCK statement. This issue is more likely to occur if the FLUSH TABLES operation is stalled by a long-running query or transaction. Refer to <mysqlbackup introduction section> for guidelines about backup timing and performance.