# Pxc\_strict\_mode = ENFORCING on single node install

**URL:** <https://forums.percona.com/t/pxc-strict-mode-enforcing-on-single-node-install/31234>\
**Category:** Percona Everest\
**Created:** [June 25, 2024, 2:20pm UTC](https://forums.percona.com/t/pxc-strict-mode-enforcing-on-single-node-install/31234 "2024-06-25T14:20:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joshua\_Sierles](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/joshua_sierles/32/13225_2.png) [@Joshua\_Sierles](https://forums.percona.com/u/Joshua_Sierles)\
**Post date:** [June 25, 2024, 2:20pm UTC](https://forums.percona.com/t/pxc-strict-mode-enforcing-on-single-node-install/31234/1 "2024-06-25T14:20:41Z")

</div>

I’m testing Everest with Rails which uses advisory locks and prepared statements. Right out of the box, attempting to create a database migration causes this error:

`Percona-XtraDB-Cluster prohibits use of GET_LOCK with pxc_strict_mode = ENFORCING`

Docs suggest this is the default behavior and should be left that way, for multinode clusters. But, this is also the default on a single node. What’s the reason for that? Is it still not advisable to use another mode on single node installs?

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [June 25, 2024, 8:41pm UTC](https://forums.percona.com/t/pxc-strict-mode-enforcing-on-single-node-install/31234/2 "2024-06-25T20:41:07Z")

</div>

If you understand the risks, you can change the mode on single node installs. We default to ENFORCING in all cases because that is the best practice. There are several other things that strict\_mode handles which are best practice.

---

<div class="post-metadata">

**Author:** ![Joshua\_Sierles](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/joshua_sierles/32/13225_2.png) [@Joshua\_Sierles](https://forums.percona.com/u/Joshua_Sierles)\
**Post date:** [June 27, 2024, 5:39am UTC](https://forums.percona.com/t/pxc-strict-mode-enforcing-on-single-node-install/31234/3 "2024-06-27T05:39:43Z")

</div>

OK - I’m asking specifically here about explicit table locking. Can you explain why this feature is considered dangerous in a multi-node cluster? Can `pt-online-schema-change` be used instead in such setups?

It looks like switching to `MASTER` would work for a single node install. Would it make sense to use `MASTER` for one node, and `ENFORCING` when a cluster is scaled out?

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [June 27, 2024, 2:33pm UTC](https://forums.percona.com/t/pxc-strict-mode-enforcing-on-single-node-install/31234/4 "2024-06-27T14:33:57Z")

</div>

> [@Joshua\_Sierles](#):
>
> OK - I’m asking specifically here about explicit table locking. Can you explain why this feature is considered dangerous in a multi-node cluster?

Locks are not shared between nodes. You can acquire a lock on node1, and the same lock again on node2 and the same lock again on node3. This is why they are dangerous.

pt-osc works well with PXC because pt-osc does not use any table locks.
