MySQL主从不一致修复

场景:

线上正在服务的库由于紧急主从切换导致主从不一致,报错信息如下:

Last_Error: Coordinator stopped because there were error(s) in the worker(s). The most recent failure being: Worker 0 failed executing transaction '8fc8d9ac-a62b-11e6-a3ee-a4badb1b4a00:7649' at master log mysql-bin.000011, end_log_pos 5290535. See error log and/or performance_schema.replication_applier_status_by_worker table for more details about this failure or others, if any.

 

出现这种错误如果少量的情况可以通过orc监控程序直接跳过

 

 

手动跳过几次还可以,如果特别多的话就比较崩溃了,所以我们直接选择使用设置slave_exec_mode来处理,关于slave_exec_mode的介绍可以参考

slave_exec_mode参数对主从复制的影响

 

通过设置set global slave_exec_mode=IDEMPOTENT;等待从库和主库同步完成之后再把同步模式修改"严格模式"

set global slave_exec_mode=stric;

 

 

posted @ 2017-11-23 10:29  davygeek  阅读(654)  评论(0编辑  收藏  举报