Hi Everyone,
I am trying to migrate from traditional binary log replication to GTID-based replication.
We have a database of size 6TB, and it is a write-heavy system containing many queries that violate GTID consistency.
By setting enforce_gtid_consistency
to WARN
, I see warnings in the error log whenever the database receives queries that violate GTID consistency, as shown below:
2025-02-11T17:34:54.756063Z 10 [Warning] [MY-013229] [Server] Statement violates GTID consistency: CREATE TEMPORARY TABLE and DROP TEMPORARY TABLE are not allowed inside a transaction or inside a procedure in a transactional context when @@session.binlog_format=STATEMENT.
However, I am unable to identify the exact statements or determine which users/hosts are executing these queries.
To successfully eliminate all GTID violations, I need to identify the hosts/users responsible for these queries.
I have attempted the following methods:
- General Log: While the general log records all statements, it does not indicate whether a query violated GTID consistency or resulted in an error or warning.
- Performance Schema.events_statements_history table: This table records queries but does not include user or host information.
Is there a way to accurately track the exact queries, along with the users/hosts from which they originate, when GTID consistency violations occur?