# How do you avoid cross-database write stalls during schema changes in Galera/PXC?

**URL:** <https://forums.percona.com/t/how-do-you-avoid-cross-database-write-stalls-during-schema-changes-in-galera-pxc/41479>\
**Category:** Percona XtraDB Cluster\
**Created:** [November 23, 2026, 6:34am UTC](https://forums.percona.com/t/how-do-you-avoid-cross-database-write-stalls-during-schema-changes-in-galera-pxc/41479 "2026-11-23T06:34:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tigerdice1](https://avatars.discourse-cdn.com/v4/letter/t/e36b37/32.png) [@tigerdice1](https://forums.percona.com/u/tigerdice1)\
**Post date:** [November 23, 2026, 6:34am UTC](https://forums.percona.com/t/how-do-you-avoid-cross-database-write-stalls-during-schema-changes-in-galera-pxc/41479/1 "2026-11-23T06:34:57Z")

</div>

I’m running multiple tenant databases on a shared Percona XtraDB Cluster. We apply schema changes one tenant at a time, but with Galera’s Total Order Isolation (TOI), an `ALTER TABLE` in one tenant database caused a 5–7 second write stall on all nodes in our test. That affected writes to other tenant databases as well.

I looked at Non-Blocking Operations (NBO), but it won’t work with our current migration process. We’d like to keep applying schema changes per tenant without making major changes to the application’s migration code.

Has anyone found a reliable way to keep unrelated tenant databases writable during DDL on a shared Galera/PXC cluster? If you ran into the same issue, what worked in practice? Did you stay on a shared cluster, or move tenants to separate MySQL deployments?

---

<div class="post-metadata">

**Author:** ![anil.joshi](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/anil.joshi/32/13100_2.png) [@anil.joshi](https://forums.percona.com/u/anil.joshi)\
**Post date:** [November 23, 2026, 2:04pm UTC](https://forums.percona.com/t/how-do-you-avoid-cross-database-write-stalls-during-schema-changes-in-galera-pxc/41479/2 "2026-11-23T14:04:40Z")

</div>

@tigerdice1

The default **Total Order Isolation (TOI)** ensures data consistency by executing DDL statements in exactly the same order on all nodes. However, this also means that during the duration of the DDL, writes must be blocked across the entire cluster.

So, irrespective of your multi-tenant architecture, in a **virtually synchronous environment** like PXC/Galera, the stall issue can occur, especially if the database has a lot of concurrent threads running along with the DDL’s.

**RSU Method (Rolling Schema Upgrade)** can be an alternative for some specific cases where the below DDL types run. Not every DDL is safe to run in rolling fashion.

- Optimize table
- Adding or Dropping Secondary Index
- Renaming the index
- Changing the ROW format like table compression
- Changing Key Block Size

**pt-osc (pt-online-schema-change)** [pt-online-schema-change - Percona Toolkit Documentation](https://docs.percona.com/percona-toolkit/pt-online-schema-change.html) can be a good alternative for schema migration, as it provides various options: [pt-online-schema-change - Percona Toolkit Documentation](https://docs.percona.com/percona-toolkit/pt-online-schema-change.html#options), including flow control checks[**–max-flow-ctl**] to govern the activity smoothly.

Using pt-osc (pt-online-schema-change), though largely non-blocking, still has some restrictions as mentioned below.

- Certain actions (`create trigger, drop trigger & rename table...`) needs to be executed in quick time. Thus, sometimes due to long ongoing transactions, the required `metadata lock` might not be available and the tool responds slowly or gets stuck until it gets the desired lock. Additionally, as this runs under the TOI mode so can impact the concurrent workload performance in the cluster as the nodes have to wait for all preceding transactions to commit simultaneously.

- Also, as this tool recreates the new table and copies all the existing and new rows (`with the support of triggers`) so this requires the same amount of `free storage` on disk to be successful.

You can test the **RSU** or **pt-osc** in some testing environment if they meet your requirements. Have you already go through these options?

Well, isolating the critical applications on a separate cluster would be better if they are frequently impacted by other less critical workloads/operations (DDL, DMLs, etc.), or else plan heavy DDLs during off-hours only.

---

<div class="post-metadata">

**Author:** ![tigerdice1](https://avatars.discourse-cdn.com/v4/letter/t/e36b37/32.png) [@tigerdice1](https://forums.percona.com/u/tigerdice1)\
**Post date:** [November 23, 2026, 11:37pm UTC](https://forums.percona.com/t/how-do-you-avoid-cross-database-write-stalls-during-schema-changes-in-galera-pxc/41479/3 "2026-11-23T23:37:04Z")

</div>

Thanks for the RSU suggestion. We ran two tests on a three-node PXC cluster. **RSU alone failed our write-continuity test. RSU on a separate standby passed with the application workload routed through HAProxy to the active writer.**

- **RSU on the active writer — failed.** We ran ALTER TABLE … FORCE with session-level RSU while that same node was serving application writes. Writes to unrelated schemas still stalled during the rebuild. RSU runs the DDL locally, so application sessions sharing that node can still experience a stall.
- **RSU on a standby — passed.** We ran the same rebuild against a four-million-row test table using a direct connection to the standby. Four concurrent writers continued inserting into two unrelated schemas through HAProxy on the active node while the rebuild ran. We verified the backend hostnames to confirm that the workload and DDL were on different nodes.

For a planned rolling schema change, our proposed sequence is to take one node out of HAProxy rotation, allow existing application sessions on that node to drain, and run the DDL directly on it with session-level RSU. Once the node is Synced, has caught up on replication, and has the expected table definition, return it to rotation and repeat on the next node. Before taking the active writer out of rotation, verify that another healthy backend can accept writes and that the application pools can reconnect to it. RSU DDL must be applied separately to each node, and the change must be compatible with the temporary mix of schema versions.

The passing test covered one standby rebuild and write continuity on the active node. We still need to validate the full rotation, including the active-writer handoff and pooled reconnects during a real schema change. Does that match the rolling procedure you’d recommend for PXC behind HAProxy?
