Common SQL Errors

MySQL Error 3227 ER_XA_REPLICATION_FILTERS - Causes and Fixes

Galaxy Team
August 8, 2025

MySQL raises ER_XA_REPLICATION_FILTERS (3227) when an XA transaction runs on a server that has replication filters enabled, a combination the engine does not support.

Sign up for the latest in common SQL errors from the Galaxy Team!
Welcome to the Galaxy, Guardian!
You'll be receiving a confirmation email

Follow us on twitter :)
Oops! Something went wrong while submitting the form.

What is MySQL error code 3227 ER_XA_REPLICATION_FILTERS?

ER_XA_REPLICATION_FILTERS appears when a MySQL XA (distributed) transaction executes on a source or replica with replication filters active. MySQL blocks this mix because it risks replica inconsistency. Remove the filters or avoid XA transactions to resolve the error.

Error Highlights

Typical Error Message

ER_XA_REPLICATION_FILTERS

Error Type

Replication Error

Language

MySQL

Symbol

not supported, and can lead to an undefined state in the replication slave. ER_XA_REPLICATION_FILTERS was added in 5.7.23.

Error Code

3227

SQL State

HY000

Explanation

Table of Contents

What is MySQL ER_XA_REPLICATION_FILTERS (3227)?

MySQL throws ER_XA_REPLICATION_FILTERS when a distributed XA transaction runs on an instance that also uses replication filtering rules such as replicate_do_db or replicate_ignore_table.

The server blocks the operation because mixing XA and replication filters can leave replicas inconsistent. The error was introduced in MySQL 5.7.23 and persists in later versions.

What Causes This Error?

The primary trigger is executing START, END, PREPARE, COMMIT, or ROLLBACK for an XA transaction while any global replication filter is configured.

Filters that cause the error include replicate_do_db, replicate_ignore_db, replicate_wild_do_table, replicate_wild_ignore_table, and replicate_rewrite_db.

How to Fix ER_XA_REPLICATION_FILTERS

Remove global replication filters, restart the instance or channel, and rerun the XA workload.

If filters are required, avoid XA by using regular InnoDB transactions or move the filtered workload to a separate channel without XA traffic.

Common Scenarios and Solutions

A replica with replicate_do_db tries to replay XA traffic from the source. Solution: drop replicate_do_db and resync.

An application issues XA BEGIN on the source that also filters tables for row-based replication. Solution: disable the filters or route XA to a dedicated channel.

Best Practices to Avoid This Error

Keep XA transactions and replication filters on separate channels or instances.

Use channel specific filters introduced in MySQL 8.0 to isolate XA traffic.

Monitor error logs for code 3227 during deployment changes.

Related Errors and Solutions

ER_XAER_NOTA - happens when XA COMMIT references a nonexistent transaction. Check transaction IDs.

ER_XAER_INVAL - indicates an invalid XA command parameter. Verify gtrid and bqual sizes.

Common Causes

Global replicate_do_db is active

When replicate_do_db limits databases, any XA transaction triggers error 3227 because the filter could hide part of the two-phase commit.

replicate_ignore_table in replica configuration

Ignoring tables while replaying XA events risks partial commits, so MySQL blocks the transaction immediately.

Wild-card table filters

Patterns set in replicate_wild_do_table or replicate_wild_ignore_table conflict with XA events that may span multiple tables.

Related Errors

ER_XAER_NOTA (1397)

Raised when an XA COMMIT or ROLLBACK references a transaction ID that is not found in the transaction cache.

ER_XAER_INVAL (1398)

Occurs when an XA command contains invalid arguments or sequence.

ER_XAER_RMFAIL (1399)

Indicates a resource manager failure during an XA operation, often due to engine crash or timeout.

FAQs

Can I use channel specific filters with XA?

Yes. MySQL 8.0 allows per channel filters that do not interfere with XA traffic on other channels.

Does GTID mode affect this error?

No. The error is raised solely on the presence of replication filters during XA, regardless of GTID settings.

Will disabling binlog cause the error to disappear?

The error relates to replication filters, not binary logging. Disabling binlog does not remove the conflict.

How does Galaxy help avoid this error?

Galaxy surfaces replication variables in its schema panel and warns users running XA commands on filtered replicas, helping you fix misconfigurations early.

Start Querying with the Modern SQL Editor Today!
Welcome to the Galaxy, Guardian!
You'll be receiving a confirmation email

Follow us on twitter :)
Oops! Something went wrong while submitting the form.

Check out some other errors

Trusted by top engineers on high-velocity teams
Aryeo Logo
Assort Health
Curri
Rubie Logo
Bauhealth Logo
Truvideo Logo