# pt-ocs LOCK TABLE WRITE on --preserve-triggers when db pxc\_strict\_mode = ENFORCING

**URL:** <https://forums.percona.com/t/pt-ocs-lock-table-write-on-preserve-triggers-when-db-pxc-strict-mode-enforcing/5823>\
**Category:** Percona Toolkit\
**Created:** [August 21, 2017, 8:20am UTC](https://forums.percona.com/t/pt-ocs-lock-table-write-on-preserve-triggers-when-db-pxc-strict-mode-enforcing/5823 "2017-08-21T08:20:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![joepmeloen12](https://avatars.discourse-cdn.com/v4/letter/j/bcef8e/32.png) [@joepmeloen12](https://forums.percona.com/u/joepmeloen12)\
**Post date:** [August 21, 2017, 8:20am UTC](https://forums.percona.com/t/pt-ocs-lock-table-write-on-preserve-triggers-when-db-pxc-strict-mode-enforcing/5823/1 "2017-08-21T08:20:32Z")

</div>

Using --preserve-triggers on pt-online-schema-change results in this error message:

Percona-XtraDB-Cluster prohibits use of LOCK TABLE/FLUSH TABLE WITH READ LOCK with pxc\_strict\_mode = ENFORCING

When looking at the script, this seems to be hardcoded:

/usr/bin/pt-online-schema-change:11074: push @$sqls, “LOCK TABLES `$args{db}`.`$args{new_tbl}` WRITE, `$args{db}`. `$args{orig_tbl}` WRITE;”;

Commenting out this line seems to work fine. Before we had to drop / create the triggers in our own management scripts and we didn’t lock there either. Anyway, two questions:

1. is it safe to use this feature without table write locking?
2. are there plans to fix the pt-osc script? I don’t like using hacked scripts; they’ll break on the next update

Kind regards,  
Joep

Ps. 3rd question: is it me, or is it true this forum doesn’t have a search option?

---

<div class="post-metadata">

**Author:** ![carlos.salguero](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/carlos.salguero/32/20_2.png) [@carlos.salguero](https://forums.percona.com/u/carlos.salguero)\
**Post date:** [August 22, 2017, 12:20pm UTC](https://forums.percona.com/t/pt-ocs-lock-table-write-on-preserve-triggers-when-db-pxc-strict-mode-enforcing/5823/2 "2017-08-22T12:20:10Z")

</div>

Hi,

If you disable locks, there might be writes to the table that won’t be catched by the triggers, so there is a chance of data loss.  
Since pxc\_strict\_mode is global, there is no way to disable it just for pt-online-schema-change.

Regarding 3rd question, you have a search box in the right top corner. Which browser are you using? Maybe it is not being rendered.

Regards
