SET GLOBAL sql_slave_skip_counter = N
This statement is valid only when the slave threads are not running. Otherwise, it produces an error.
sequence of groups known as event groups. Each event group consists of a sequence of events.
• For transactional tables, an event group corresponds to a transaction.
• For nontransactional tables, an event group corresponds to a single SQL statement.
Note
A single transaction can contain changes to both transactional and nontransactional tables.
When you use SET GLOBAL sql_slave_skip_counter to skip events and the result is in the
middle of a group, the slave continues to skip events until it reaches the end of the group. Execution
then starts with the next event group.
mysql为啥这么做是为了保证事务的一致性,一个大事务中一个sql 操作异常,那么整个大事务就必须要全部回退rollback。
一个事务具备原子性,在任何情况下都无法破坏一个事务的完整性。