diff options
author | Jon Olav Hauglid <jon.hauglid@oracle.com> | 2010-08-23 17:42:53 +0200 |
---|---|---|
committer | Jon Olav Hauglid <jon.hauglid@oracle.com> | 2010-08-23 17:42:53 +0200 |
commit | 3592489cae0115c245ef3e692bf0ec276a3e010d (patch) | |
tree | 52c222cc71331b9a444b8dd3939b3a2e6649be51 /mysql-test/suite/perfschema | |
parent | 258d892896db28388bd5337c2865287f01e2512e (diff) | |
download | mariadb-git-3592489cae0115c245ef3e692bf0ec276a3e010d.tar.gz |
Bug #54332 Deadlock with two connections doing LOCK TABLE+INSERT DELAYED
The problem was that deadlocks involving INSERT DELAYED were not detected.
The reason for this is that two threads are involved in INSERT DELAYED:
the connection thread and the handler thread. The connection thread would
wait while the handler thread acquired locks and opened the table.
In essence, this adds an edge to the wait-for-graph between the
connection thread and the handler thread that the deadlock detector is
unaware of. Therefore many deadlocks involving INSERT DELAYED were not
detected.
This patch fixes the problem by having the connection thread acquire the
metadata lock the table before starting the handler thread. This allows the
deadlock detector to detect any possible deadlocks resulting from trying to
acquire a metadata lock the table. If a metadata lock is successfully acquired,
the handler thread is started and given a copy of the ticket representing the
metadata lock. When the handler thread then tries to lock and open the table,
it will find that it already has the metadata lock and therefore not acquire
any new metadata locks.
Test cases added to delayed.test.
Diffstat (limited to 'mysql-test/suite/perfschema')
0 files changed, 0 insertions, 0 deletions