暂无图片
MySQL8.0GTID主从同步每周必报一次1032
我来答
分享
pull
2021-03-18
MySQL8.0GTID主从同步每周必报一次1032

生产环境MySQL8.0.21 gtid主从同步,每周因为同一张表必报一次1032,该表是定时任务,检测系统与各主机间的是否能连通,所以该表只进行update操作,binlog为row格式。
这是程序中的SQL:update RESOURCE_PLATFORM_REF t set t.isconnect=’’ ,t.created_time=now() where t.resource_id=’’ and t.platform_ip=’’
各位大佬给解答一下如何才能解决此问题

Last_SQL_Errno: 1032
Last_SQL_Error: Coordinator stopped because there were error(s) in the worker(s). The most recent failure being: Worker 1 failed executing transaction ‘55c02165-2b06-11eb-981f-fa163eb9e040:59226840’ at master log binlog.000437, end_log_pos 851377797. See error log and/or
performance_schema.replication_applier_status_by_worker table for more details about this failure or others, if any.

mysqlbinlog --no-defaults -v -v --base64-output=DECODE-ROWS binlog.000437 | grep -A ‘15’ 851377797

#210318 4:10:14 server id 83 end_log_pos 851377797 CRC32 0xf74ca5a5 Update_rows: table id 183879 flags: STMT_END_F

UPDATE qtzh.resource_platform_ref

WHERE

@1=5250 /* DECIMAL(32,0) meta=8192 nullable=1 is_null=0 */

@2=‘172.31.5.170’ /* VARSTRING(400) meta=400 nullable=1 is_null=0 */

@3=‘1’ /* VARSTRING(40) meta=40 nullable=1 is_null=0 */

@4=‘2021-03-18 01:36:00’ /* DATETIME(0) meta=0 nullable=1 is_null=0 */

SET

@1=5250 /* DECIMAL(32,0) meta=8192 nullable=1 is_null=0 */

@2=‘172.31.5.170’ /* VARSTRING(400) meta=400 nullable=1 is_null=0 */

@3=‘1’ /* VARSTRING(40) meta=40 nullable=1 is_null=0 */

@4=‘2021-03-18 04:10:14’ /* DATETIME(0) meta=0 nullable=1 is_null=0 */

at 851377797

我来答
添加附件
收藏
分享
问题补充
1条回答
默认
最新
始于脚下

有可能出在now()函数上,很坑的,从库执行的时候,now()函数产生的时间是与主库执行时有差异了,造成该表在主从环境中数据不一致。

暂无图片 评论
暂无图片 有用 3
回答交流
提交
问题信息
请登录之后查看
邀请回答
暂无人订阅该标签,敬请期待~~
暂无图片墨值悬赏