Lixora's DB Home

Focus, Fast, Efficent!

关于 mysql SET GLOBAL sql_slave_skip_counter = N 的一点记录

SET GLOBAL sql_slave_skip_counter = N


This statement skips the next N events from the master. This is useful for recovering from replication stops caused by a statement.

This statement is valid only when the slave threads are not running. Otherwise, it produces an error.


When using this statement, it is important to understand that the binary log is actually organized as a
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。

一个事务具备原子性,在任何情况下都无法破坏一个事务的完整性。

阅读更多
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/royjj/article/details/78683751
个人分类: MySql
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

不良信息举报

关于 mysql SET GLOBAL sql_slave_skip_counter = N 的一点记录

最多只允许输入30个字

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭