点击上方“IT那活儿”公众号,关注后了解更多内容,不管IT什么活儿,干就完了!!!
故障现象
DB:mysql 6.7 主从
故障现象
主从线程未running,同步中断。
Could not execute Write_rows event on table
skdata_2021.pj_xxxx_fpmx; Duplicate entry 043002000111-
01278925 for key ak_key_2,
Error_code: 1062; handler error HA_ERR_FOUND_DUPP_KEY; the
events master log master-bin.000403, end_log_pos 333202176
处理步骤
方法一:对于数据量少的时候适用
show variables like %slave_exec_mode%;
set global slave_exec_mode=IDEMPOTENT;
stop slave;
start slave;
set global slave_exec_mode=STRICT;
stop slave;
start slave;
Could not execute Update_rows event on table
skdata_2021.qrtz_scheduler_state; Cant find record in
qrtz_scheduler_state,
Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the
events master log master-bin.000403, end_log_pos 333327330
把更新前记录找出,并在从库插入执行,再启动slave sql进程
SET @@session.collation_database=DEFAULT/*!*/;
BEGIN
/*!*/;
# at 333327142
#210628 10:41:19 server id 127 end_log_pos 333327216 CRC32 0xb31a9243 Table_map: `skdata_2021`.`qrtz_scheduler_state` mapped to number 110214
# at 333327216
#210628 10:41:19 server id 127 end_log_pos 333327330 CRC32 0x85a6c09f Update_rows: table id 110214 flags: STMT_END_F
### UPDATE `skdata_2021`.`qrtz_scheduler_state`
### WHERE
### @1=fpskgl21616596076563
### @2=1624848058505
### @3=20000
### SET
### @1=fpskgl21616596076563
### @2=1624848078982
### @3=20000
ROLLBACK /* added by mysqlbinlog */ /*!*/;
SET @@SESSION.GTID_NEXT= AUTOMATIC /* added by mysqlbinlog */ /*!*/;
DELIMITER ;
# End of log file
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
set sql_log_bin=0;
insert into `skdata_2021`.`qrtz_scheduler_state` values (fpskgl21616596076563,1624848058505,20000);
commit;
set sql_log_bin=1;
start slave sql_thread;
文章版权归作者所有,未经允许请勿转载,若此文章存在违规行为,您可以联系管理员删除。
转载请注明本文地址:https://www.ucloud.cn/yun/129280.html
摘要:编辑器编辑器背景编辑器前段时间遇到一个线上问题,后来排查好久发现是因为主从同步延迟导致的,所以今天写一篇文章总结一下这个问题希望对你有用。编辑器几句唠叨编辑器大家好,我是小饭,一枚后端工程师。背景前段时间遇到一个线上问题,后来排查好久发现是因为主从同步延迟导致的,所以今天写一篇文章总结一下这个问题希望对你有用。如果觉得还不错,记得加个关注点个赞哦思维导图思维导图常见的主从架构随着日益增长的访...
阅读 1347·2023-01-11 13:20
阅读 1685·2023-01-11 13:20
阅读 1133·2023-01-11 13:20
阅读 1860·2023-01-11 13:20
阅读 4101·2023-01-11 13:20
阅读 2705·2023-01-11 13:20
阅读 1386·2023-01-11 13:20
阅读 3598·2023-01-11 13:20