Bug 248091

Summary: Read lock unable to be removed on mysql-server-5.0.18-4.el4s1.1
Product: Red Hat Enterprise Linux 4 Reporter: Anchor Systems Managed Hosting <managed>
Component: mysqlAssignee: Tom Lane <tgl>
Status: CLOSED INSUFFICIENT_DATA QA Contact:
Severity: urgent Docs Contact:
Priority: low    
Version: 4.5CC: byte, hhorak
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
URL: http://bugs.mysql.com/bug.php?id=17741
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-04-28 21:58:50 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Anchor Systems Managed Hosting 2007-07-13 06:13:14 UTC
Description of problem:

Occasionally we are seeing a problem with a read lock that cannot be removed.
The server is a replication slave and so the read lock that is applied to all
tables is blocking the sql slave thread and hence replication fails. The read
lock is put in place by a database backup script that runs every ten minutes and
then removes the lock.

Version-Release number of selected component (if applicable):

5.0.18-4.el4s1.1 from the Red Hat Web Application Stack Beta 1.0 Channel

How reproducible:

It does not occur frequently. Every few days we may see the problem, and
'mysqladmin debug' does not offer any good diagnostics to show what is holding
open the lock.

Steps to Reproduce:
1. The script that takes the backup runs every ten minutes
2. In one thread it issues 'FLUSH TABLES WITH READ LOCK', then it starts a
mysqlbackup of all databases with no locks. Finally, 'UNLOCK TABLES' is issued
in the first thread.
3. 'show processlist' shows that the slave sql thread is waiting on a read lock
to make an insert or update from the replication data. However there are no
other threads running which have the outstanding lock.
4. 'show slave status' shows the seconds from master steadily increasing.
5. Issuing 'unlock tables' in a mysql interactive session does not appear to
remove the lock as the slave sql thread still mentions it is waiting on a read lock.
6. Issuing 'stop slave' hangs, and isn't able to stop the slave.
7. Mysql must be restarted to get rid of the lock.
  
Actual results:
A phantom read lock prevents the slave sql thread from updating the database.

Expected results:
The read lock should be removed as soon as 'unlock tables' is issued by the client.

Additional info:
There doesn't appear to be any way to diagnose the state of locks on the MySQL
server, which could be used to determine the origin of this problem.

Comment 1 Anchor Systems Managed Hosting 2007-07-13 06:50:53 UTC
May be related to this bug:

http://bugs.mysql.com/bug.php?id=17741

Comment 2 Tom Lane 2007-07-13 15:09:24 UTC
The currently shipping Application Stack release of mysql is 5.0.30.  Please update and see whether the 
problem still exists.

Comment 3 Anchor Systems Managed Hosting 2007-07-16 01:47:11 UTC
The Red Hat Web Application Stack 1.0 Beta (for ES v. 4 AMD64/EM64T) channel
(https://rhn.redhat.com/network/software/channels/details.pxt?cid=5271) shows
that  mysql-server-5.0.18-4.el4s1.1.x86_64 is the latest available package.

Comment 4 Tom Lane 2007-07-16 02:53:53 UTC
I do not know why you are subscribed to a beta channel for a product that was released many months ago, 
but I cannot provide support for an ancient beta version.  Please update to the current release and let me 
know whether it still shows the bug.

Comment 5 Tom Lane 2008-04-28 21:58:50 UTC
Closing for lack of response.