# pt-online-schema-change: alter not working because of pxc\_strict\_mode = ENFORCING

**URL:** <https://forums.percona.com/t/pt-online-schema-change-alter-not-working-because-of-pxc-strict-mode-enforcing/7526>\
**Category:** Percona XtraDB Cluster 5.x\
**Created:** [April 10, 2020, 9:33am UTC](https://forums.percona.com/t/pt-online-schema-change-alter-not-working-because-of-pxc-strict-mode-enforcing/7526 "2020-04-10T09:33:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ronny\_Gorner](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/ronny_gorner/32/3099_2.png) [@Ronny\_Gorner](https://forums.percona.com/u/Ronny_Gorner)\
**Post date:** [April 10, 2020, 9:33am UTC](https://forums.percona.com/t/pt-online-schema-change-alter-not-working-because-of-pxc-strict-mode-enforcing/7526/1 "2020-04-10T09:33:25Z")

</div>

Howdy,first, thanks to all supporting this cool piece of software.However, we have a small issue (maybe not even a small but a major) on changing tables using Alter commands or scheme changes. This would normally result in locking the cluster, so we deciced to use pt-online-schema-change to avoid those problems.pt-online-schema-change --execute --statistics --preserve-triggers --alter “ADD COLUMN test varchar(255) DEFAULT 1 AFTER abfragescore\_id” D=webhaus\_live,t=scoring\_bankverb\_scoreresults in   
2020-04-07T10:06:18 Creating triggers…  
2020-04-07T10:06:18 Created triggers OK.  
2020-04-07T10:06:18 Copying approximately 1506132 rows…  
2020-04-07T10:06:45 Copied rows OK.  
2020-04-07T10:06:45 Adding original triggers to new table.  
Exiting due to errors while restoring triggers: DBD::mysql::db do failed: Percona-XtraDB-Cluster prohibits use of LOCK TABLE/FLUSH TABLE \<table\> WITH READ LOCK/FOR EXPORT with pxc\_strict\_mode = ENFORCING [for Statement “LOCK TABLES `webhaus_live`.` ______ scoring_bankverb_score_new` WRITE, `webhaus_live`. `scoring_bankverb_score` WRITE;”] at /usr/bin/pt-online-schema-change line 9929.  
2020-04-07T10:06:45 Dropping triggers…  
2020-04-07T10:06:45 Dropped triggers OK.  
Not dropping the new table `webhaus_live`.` ______ scoring_bankverb_score_new` because --swap-tables failed.&nbsp; To drop the new table, execute:  
DROP TABLE IF EXISTS `webhaus_live`.` ______ scoring_bankverb_score_new`;  
# Event&nbsp; Count  
# ====== =====  
# INSERT&nbsp;&nbsp;&nbsp; 57  
`webhaus_live`.`scoring_bankverb_score` was not altered.  
  
For me, it seems, this is not working because of using ENFORCING mode in the cluster.Is there any workaround on this to let it work?Best to all and keep healthy,Ronny

---

<div class="post-metadata">

**Author:** ![DGB](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/dgb/32/79_2.png) [@DGB](https://forums.percona.com/u/DGB)\
**Post date:** [May 8, 2020, 8:09am UTC](https://forums.percona.com/t/pt-online-schema-change-alter-not-working-because-of-pxc-strict-mode-enforcing/7526/2 "2020-05-08T08:09:15Z")

</div>

Hi  
The workaround is to set the pxc-strict-mode to “MASTER”&nbsp;[https://www.percona.com/doc/percona-xtradb-cluster/LATEST/features/pxc-strict-mode.html#explicit-table-locking](https://www.percona.com/doc/percona-xtradb-cluster/LATEST/features/pxc-strict-mode.html#explicit-table-locking "Link: https://www.percona.com/doc/percona-xtradb-cluster/LATEST/features/pxc-strict-mode.html#explicit-table-locking")  
The LOCK TABLES … WRITE is used to create the triggers, and was introduced in version 3 of the toolkit (version 2.2 don’t have it)  
Remember to rollback pxc-strict-mode to ENFORCING onces the pt-osc task ends.

---

<div class="post-metadata">

**Author:** ![Ronny\_Gorner](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/ronny_gorner/32/3099_2.png) [@Ronny\_Gorner](https://forums.percona.com/u/Ronny_Gorner)\
**Post date:** [May 11, 2020, 6:10am UTC](https://forums.percona.com/t/pt-online-schema-change-alter-not-working-because-of-pxc-strict-mode-enforcing/7526/3 "2020-05-11T06:10:02Z")

</div>

> DGB said: Hi  
> The workaround is to set the pxc-strict-mode to "MASTER"&nbsp;[https://www.percona.com/doc/percona-xtradb-cluster/LATEST/features/pxc-strict-mode.html#explicit-table-locking](https://www.percona.com/doc/percona-xtradb-cluster/LATEST/features/pxc-strict-mode.html#explicit-table-locking "Link: https://www.percona.com/doc/percona-xtradb-cluster/LATEST/features/pxc-strict-mode.html#explicit-table-locking")  
> The LOCK TABLES ... WRITE is used to create the triggers, and was introduced in version 3 of the toolkit (version 2.2 don't have it)  
> Remember to rollback pxc-strict-mode to ENFORCING onces the pt-osc task ends.

  
Is it possible to set pxc mode on the fly without restart? -\> Seems so. So maybe, we could use a flag in the script? Or maybe we can check the BEGIN/COMMIT option -\> this would not infect any setting and not break Group replication (if enabled) by MySQL
