# Deadlock found when trying to get lock; try restarting transaction?

**URL:** <https://forums.percona.com/t/deadlock-found-when-trying-to-get-lock-try-restarting-transaction/8393>\
**Category:** Percona XtraDB Cluster\
**Tags:** mysql\
**Created:** [December 15, 2020, 9:03am UTC](https://forums.percona.com/t/deadlock-found-when-trying-to-get-lock-try-restarting-transaction/8393 "2020-12-15T09:03:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lokesh123](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/lokesh123/32/5519_2.png) [@lokesh123](https://forums.percona.com/u/lokesh123)\
**Post date:** [December 15, 2020, 9:03am UTC](https://forums.percona.com/t/deadlock-found-when-trying-to-get-lock-try-restarting-transaction/8393/1 "2020-12-15T09:03:34Z")

</div>

When I run any procedure on my percona xtradb cluster 8.0. someimes

I got the error.

**Deadlock found when trying to get lock; try restarting transaction.**

and did not allow to run the mysql procedure.

any idea.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![Ivan\_Groenewold](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/ivan_groenewold/32/6299_2.png) [@Ivan\_Groenewold](https://forums.percona.com/u/Ivan_Groenewold)\
**Post date:** [December 16, 2020, 5:50am UTC](https://forums.percona.com/t/deadlock-found-when-trying-to-get-lock-try-restarting-transaction/8393/2 "2020-12-16T05:50:04Z")

</div>

Hi, have a look at [https://dev.mysql.com/doc/refman/8.0/en/innodb-parameters.html#sysvar\_innodb\_print\_all\_deadlocks](https://dev.mysql.com/doc/refman/8.0/en/innodb-parameters.html#sysvar_innodb_print_all_deadlocks) option. This should give you some pointers in the error log to identify the conflicting transactions.

---

<div class="post-metadata">

**Author:** ![hmilkovi](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/hmilkovi/32/3034_2.png) [@hmilkovi](https://forums.percona.com/u/hmilkovi)\
**Post date:** [November 19, 2021, 8:44pm UTC](https://forums.percona.com/t/deadlock-found-when-trying-to-get-lock-try-restarting-transaction/8393/3 "2021-11-19T20:44:31Z")

</div>

Also check awesome tool that helped me: `pt-deadlock-logger` .  
With it I was able to fast solve all deadlock problems 🙂 .
