MySQL raises error 3176 when an XA transaction attempts to modify the internal mysql.gtid_executed table, risking GTID inconsistency.
MySQL error 3176 (ER_ERROR_ON_MODIFYING_GTID_EXECUTED_TABLE) occurs when you update mysql.gtid_executed inside an XA transaction. Use a normal, non-XA statement or avoid touching this system table to clear the error.
ER_ERROR_ON_MODIFYING_GTID_EXECUTED_TABLE
MySQL error 3176 appears whenever an XA transaction tries to change the mysql.gtid_executed table. This system table tracks Global Transaction Identifiers (GTIDs) for every committed transaction in a server or replication topology.
The server blocks XA modifications to preserve GTID consistency. The error was introduced in MySQL 5.7.11, when the GTID subsystem gained stricter safeguards.
An XA transaction spans multiple resource managers. Because GTIDs must be globally unique and sequential, changing mysql.gtid_executed within an XA block can leave partial GTID updates across resources, so MySQL forbids it.
Most triggers include application frameworks that wrap all writes in XA START/END, manual troubleshooting updates to mysql.gtid_executed, and mis-configured backup or migration scripts.
Stop using XA for statements that touch mysql.gtid_executed. Run the update or insert in a standalone autocommit session or a regular BEGIN/COMMIT block.
If your goal was to purge or inject GTIDs, prefer the built-in statements SET GTID_PURGED or RESET MASTER, which are GTID-aware and safe.
Hot-fix scripts sometimes attempt to delete errant GTIDs after failed replication. Rewrite the script to disable XA and rely on SET GTID_PURGED.
Some ORM layers default to XA for transactional integrity. Configure them to issue a simple COMMIT when altering mysql system tables.
Never modify mysql.gtid_executed unless absolutely required. Use vendor-provided GTID utilities first. Guard system tables with read-only accounts.
Galaxy users can set connection-level flags in the editor to forbid XA before running sensitive maintenance queries, ensuring the error never surfaces in production.
Error 3170 (ER_GTID_PURGED_WAS_CHANGED) arises when SET GTID_PURGED conflicts with existing GTIDs. Resolve by resetting master or aligning GTID sets.
Error 1782 (ER_CANT_SET_GTID_PURGED_WHILE_GTID_EXECUTED) occurs if GTID_EXECUTED is not empty. Empty the set first or enable OFFLINE mode.
Middleware configures XA START automatically, and a maintenance script then touches mysql.gtid_executed, triggering error 3176.
An administrator manually updates or deletes rows in mysql.gtid_executed during replication troubleshooting inside an XA session.
A third-party tool uses XA to ensure consistency and unknowingly modifies mysql.gtid_executed, causing the operation to fail.
Raised when SET GTID_PURGED conflicts with existing GTID_EXECUTED values.
Thrown if GTID_PURGED is altered while GTID_EXECUTED changes concurrently.
Occurs when an XA transaction is left in PREPARED state and a COMMIT or ROLLBACK is missing.
Only use direct edits when directed by Oracle support or official documentation, and never inside an XA transaction.
Yes. A failed edit inside XA can leave GTID sets inconsistent, breaking replication start positions.
No. SET GTID_PURGED is GTID-aware and allowed outside XA, making it the recommended approach.
Galaxy lets you create protected snippets that block XA statements on system tables and flags risky queries before execution.