Troubleshooting
Common replication problems: duplicate key errors, missing tables, network interruption, and disk full on replica. Each has specific remediation steps.
Common replication problems: duplicate key errors, missing tables, network interruption, and disk full on replica. Each has specific remediation steps.
-- Replication stopped — check error
SHOW REPLICA STATUS\G -- Last_Error, Last_SQL_Error
-- Skip one erroneous event (use carefully)
SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
START REPLICA;
-- GTID mode: skip specific transaction
SET GTID_NEXT = "source_uuid:problematic_gtid";
BEGIN; COMMIT; -- empty transaction to consume the GTID
SET GTID_NEXT = "AUTOMATIC";
-- Rebuild replica from scratch (if too far behind)
-- 1. Take XtraBackup from primary
-- 2. Restore on replica
-- 3. CHANGE REPLICATION SOURCE ... SOURCE_AUTO_POSITION=1
Skipping errors masks data inconsistency — investigate the root cause before skipping in production.