关闭

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

105人阅读 评论(1) 收藏 举报
分类:

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。

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

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:747047次
    • 积分:15465
    • 等级:
    • 排名:第877名
    • 原创:682篇
    • 转载:95篇
    • 译文:11篇
    • 评论:87条
    博客专栏
    oracle blog
    最新评论