MySQL error1317,MySQL 中的 -Error_code:1317-爱可生

原标题:MySQL 中的 -Error_code:1317-爱可生

add5ace8610d9fd9bc63fc325191b234.png

问题背景

MySQL 从库报错如下:

c09f10ec5e6aab69ce9e0419a585f578.png

错误信息如下:

Last_Errno:1317

Last_Error:Last_Error: Coordinator stopped because there were error(s) in the worker(s). The most recent failure being: Worker 1 failed executing transaction 'a838ba08-c009-11e9-85e1-fa163ea2992d:31622919405' at master log master-bin.005599, end_log_pos 2297. See error log and/or performance_schema.replication_applier_status_by_worker table for more details about this failure or others, if any.

Last_SQL_Errno:1317

Last_SQL_Error:Last_Error: Coordinator stopped because there were error(s) in the worker(s). The most recent failure being: Worker 1 failed executing transaction 'a838ba08-c009-11e9-85e1-fa163ea2992d:31622919405' at master log master-bin.005599, end_log_pos 2297. See error log and/or performance_schema.replication_applier_status_by_worker table for more details about this failure or others, if any.

排查方式

1. 首先我们先通过 performance_schema 查看一下造成报错的原因

mysql> select * from performance_schema.replication_applier_status_by_worker;

c9b3d88a90d1f28a319076fb36ad1f66.png

从这里报错看到,某条语句在回放的时候查询执行被中断了。

2. 然后我们再查看 MySQL 的 error-log

4e5a915e3d0b0c22fe0b562c93ee8fb9.png

日志中也提示了我们,因为工作线程被断开,查询中断,它在当前这个位置点停止了,如果想要恢复重新启动主从即可。

3. 尝试重新启动主从

mysql> stop slave;

mysql> start slave;

b2c7a6c5bb6104a6fc8c5637bec790ba.png

重启复制通道后,复制确实正常了,接下来需要知道为什么查询被中断了。

4. 带着疑问,去看了下在报错的这个时间里 MySQL 或是服务器做了什么,然后发现了这个时间 MySQL 在做备份,之后查看 xtrabackup 备份参数是带着 --kill-long-queries-timeout=60 和 --kill-long-query-type=all。

8bf2480c3f76f5296ada0698fd0c771c.png

简单来说就是,当 --kill-long-query-type=all,--kill-long-queries-timeout=60,从开始执行 FLUSH TABLES WITH READ LOCK 到 kill 掉阻塞它的这些查询之间等待的秒数为 60 秒,默认值为 0,不会 kill 任何查询,使用这个选项 xtrabackup 需要有 Process 和 super 权限。

5. 然后查看 xtrabackup 的备份日志,一切答案见了分晓。

责任编辑:

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值