# Pt-online-schema-change - Exiting due to errors while restoring triggers: DBD::mysql::db do failed: Lock wait timeout exceeded; try restarting transaction

**URL:** <https://forums.percona.com/t/pt-online-schema-change-exiting-due-to-errors-while-restoring-triggers-dbd-db-do-failed-lock-wait-timeout-exceeded-try-restarting-transaction/8911>\
**Category:** Percona XtraDB Cluster 5.x\
**Tags:** percona\
**Created:** [January 24, 2021, 8:57am UTC](https://forums.percona.com/t/pt-online-schema-change-exiting-due-to-errors-while-restoring-triggers-dbd-db-do-failed-lock-wait-timeout-exceeded-try-restarting-transaction/8911 "2021-01-24T08:57:10Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![bob](https://avatars.discourse-cdn.com/v4/letter/b/ea666f/32.png) [@bob](https://forums.percona.com/u/bob)\
**Post date:** [January 28, 2021, 12:28pm UTC](https://forums.percona.com/t/pt-online-schema-change-exiting-due-to-errors-while-restoring-triggers-dbd-db-do-failed-lock-wait-timeout-exceeded-try-restarting-transaction/8911/6 "2021-01-28T12:28:02Z")

</div>

Dunno if it’s related, but restoring triggers is an issue for me too, even when ptosc completes:  
See:

> [@Triggers dropped after pt-osc usage](https://forums.percona.com/t/triggers-dropped-after-pt-osc-usage/7655):
>
> Good day,I’m facing strange issue, not for a first time. Sometimes it appears, sometimes it does not. I’m expecting it’s related to “drop\_swap” method. Table stats\_table2 is having 3 triggers. after running, all looks mint: At this moment table stats\_table2 is not having 3 triggers. I’m always dumping triggers before running pt-osc - and in case of loosing triggers I’m importing them back again.Anyone faced similar behaviour, am I missing something in parameters? Any advice is highly apprec…

[https://jira.percona.com/browse/PT-1919](https://jira.percona.com/browse/PT-1919)

I could only avoid the issue by ensuring the FK mode rebuild\_constraint and avoiding the drop\_swap.  
Maybe that can help you.

---

_[View the full topic](https://forums.percona.com/t/pt-online-schema-change-exiting-due-to-errors-while-restoring-triggers-dbd-db-do-failed-lock-wait-timeout-exceeded-try-restarting-transaction/8911)._
