Why another article on this Marco?
Deadlocks is a topic covered many times and with a lot of
articles on the web, also from Percona.
I suggest you review the reference section for articles on how to identify Deadlocks and from where they are generated.
So why another article?
The answer is that messages like the following are still very common:
User (John): “Marco our MySQL is having problems”
Marco: “Ok John what problems. Can you be a bit more specific?”
John: “Our log scraper is collecting that MySQL has a lot of errors”
Marco: “Ok can you share the MySQL log so I can review it?”
John: “Errors are in the application log, will share one application log”
Marco reviews the log and in it he founds:
“ERROR 1213 (40001): Deadlock found when trying to get lock; try restarting transaction”
Marco reaction is: "Oh my ..."