Bug #45101 Query Cache Deadlock causes mysql server to hang
Submitted: 26 May 2009 16:49 Modified: 18 Jun 2009 15:08
Reporter: John David Duncan Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Query Cache Severity:S3 (Non-critical)
Version:mysql-5.1.32-ndb-6.3.23 OS:Linux
Assigned to: Assigned Account CPU Architecture:Any

[26 May 2009 16:49] John David Duncan
Description:
A deadlock is possible in the query cache.  In this example the deadlock is seen when the data is stored in NDB Cluster.  If the cluster data nodes are tuned well, the deadlock is quite rare -- but by "badly" tuning the NDB nodes we can reliably reproduce the problem within a few minutes. 

There is a stack trace at https://intranet.mysql.com/secure/paste/displaypaste.php?codeid=7956 (not visible to the general public -- sorry).

In this trace, threads 5 and 24 are running a SELECT and waiting for a table lock in mysql_lock_tables().  Thread 15 is waiting for a lock in Query_cache::store_query().   And many other threads are waiting for locks in Query_cache::invalidate_table().

How to repeat:
We do not have direct access to the data and code needed to reproduce this problem.
[26 May 2009 16:51] John David Duncan
Support has suggested that this might be related to bug # 43758
[18 Jun 2009 15:08] Andrew Hutchings
This is almost certainly a duplicate of bug #37827 now.  Closing it as such.