Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Incomplete
-
5.5.36
-
None
-
None
-
Linux FC11
Description
Hi Guys, im having a query that takes like 2-5 seconds to execute, but sometimes is causing a deadlock...
Like 1 thread is "Sending data" indefinitely (>3 hours) and everything else is waiting in "Waiting for table metadata lock", this query would take only a couple of seconds, it's issued eg. 5000 times in short period of time (with very short wait between the queries)
From spec i'm seeing this:
>To ensure transaction serializability, the server must not permit one session to perform a data definition language (DDL) statement on a table that is used in an uncompleted transaction in another session.
Question is why all threads are waiting for "DDL" lock while no DDL operations are running (does lock table for write requires metadata lock?)
(A) Here is the offending query, after killing it everything gets processed.
http://screencast.com/t/Pg7fbNXZo
(B) There is another query like this, this was issued after the first one...
http://screencast.com/t/0QqRi8fZMWXQ
General states:
http://screencast.com/t/XOvtlqp4egB
Everything is waiting for metadata, one replication, one send thread.
The questions are ...
1. Bug?
2. Could the second query (B) issued after (A) cause deadlock because it's accessing similar tables?
3. CREATE TEMPORARY ... SELECT ... FROM A, B, C will grab DDL WRITE (not read) lock no only on the temp table but also on ABC?
4. If server picked only one thread to "run" why it isn't able to get any data (if it's sending, all locks should be acquired already?)
For reproducing, i can only send SHOW PROCESSLIST dump, because this happens like once every month, so no idea how more info about the issue can be extracted...
Thanks as always...