Why would you ever want to deliberately cause a deadlock?
Sometimes a very large deadlock in MySQL will fill the output of
SHOW ENGINE INNODB STATUS
until it truncates, so you
can't see information about transactions, log and I/O, buffers,
and so forth. I know only two solutions to this problem: 1)
restart MySQL and 2) cause a small deadlock so the LAST
DETECTED DEADLOCK
section shrinks to an acceptable size.
In this article I'll show you how to cause a small deadlock, and
how to use innotop to do it more easily.
This article is part of a series on how to use innotop to make your life easier.