17.1.7.3 Skipping Transactions

If replication stops due to an issue with an event in a replicated transaction, you can resume replication by skipping the failed transaction on the replica. Before skipping a transaction, ensure that the replication I/O thread is stopped as well as the SQL thread.

First you need to identify the replicated event that caused the error. Details of the error and the last successfully applied transaction are recorded in the Performance Schema table replication_applier_status_by_worker. You can use mysqlbinlog to retrieve and display the events that were logged around the time of the error. For instructions to do this, see Section 7.5, “Point-in-Time (Incremental) Recovery”. Alternatively, you can issue SHOW RELAYLOG EVENTS on the replica or SHOW BINLOG EVENTS on the source.

Before skipping the transaction and restarting the replica, check these points:

To skip the transaction, choose one of the following methods as appropriate:

To restart replication after skipping the transaction, issue START REPLICA | SLAVE, with the FOR CHANNEL clause if the replica is a multi-source replica.

17.1.7.3.1 Skipping Transactions With GTIDs
17.1.7.3.2 Skipping Transactions Without GTIDs