1791
MariaDBERRORNotableReplicationHIGH confidence
sql_slave_skip_counter cannot be set in GTID mode
Production Risk
High — incorrect use can cause data divergence.
What this means
SET GLOBAL sql_slave_skip_counter is not supported when GTID mode is ON because GTID-based replication uses a different mechanism for skipping transactions.
Why it happens
- 1Attempting to set sql_slave_skip_counter while gtid_mode=ON.
How to reproduce
trigger — this will error
trigger — this will error
SET GLOBAL sql_slave_skip_counter = 1; -- with GTID mode ON
expected output
ERROR 1791 (HY000): sql_slave_skip_counter cannot be set when GTID_MODE = ON.
Fix
Use GTID-based transaction injection to skip a transaction
Use GTID-based transaction injection to skip a transaction
STOP SLAVE; SET GTID_NEXT='source_uuid:N'; -- the GTID to skip BEGIN; COMMIT; SET GTID_NEXT='AUTOMATIC'; START SLAVE;
Why this works
Injects an empty transaction with the problematic GTID, marking it as applied.
What not to do
✕
Sources
Official documentation ↗
MySQL 8.0 — 1791 ER_SQL_SLAVE_SKIP_COUNTER_NOT_SETTABLE_IN_GTID_MODE
Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev