mysql1756_MySQL Error_code: 1756

昨天线上发现一个数据库诡异问题,在这里记录下问题的发现以及处理的过程。

研发的同事反馈一个数据库的数据从19:44就没有更新了(该从库线上服务不适用,只是线下查询以及统计数据使用)。但是登录到从库查看发现主从同步正常,负责主从同步的两个进程为yes,主从延迟为0,Slave_SQL_Running_State为Waiting for Slave Workers to free pending events

Waiting for Slave Workers to free pending events

This waiting action occurs when the total size of events being processed by Workers exceeds the size of theslave_pending_jobs_size_max system variable. The Coordinator resumes scheduling when the size drops below this limit. This state occurs only when slave_parallel_workers is set greater than 0.

翻译如下:

这个等待状态会在什么时候发生呢?这个状态只会在

b210bc2f5a98701c5ce7f6fa5937efb6.png

查看错误日志信息

2019-09-02T20:45:40.060392+08:00 6 [ERROR] Slave SQL for channel '': ... The slave coordinator and worker threads are stopped, possibly leaving data in inconsistent state. A restart should restore consistency automatically, although using non-transactional storage for data or info tables or DDL queries could lead to problems. In such cases you have to examine your data (see documentation for details). Error_code: 1756

show variables like '%slave_pending_jobs_size_max%'; 默认为16M

3999c1694482f88ad907c104b37ca35c.png

show variables like 'max_allowed_packet'; 为512M

cc086b0c1a8f609212b72ac80457df72.png

解决:

先修改slave_pending_jobs_size_max的大小为128M

停止slave

stop slave; 命令发出后一直在等待

只能用kill -9 杀掉进程;(因为我这个是从库,停掉后不影响业务,具体情况具体处理)

将slave_pending_jobs_size_max=128M 写进配置文件。

启动MySQL后状态变为show slave status\G

Slave_SQL_Running_State:变为 Waiting for dependent transaction to commit

Relay_Master_Log_File: Master-mysql-bin.001676

Exec_Master_Log_Pos: 798682256 一直没有改变,说明从库没有回放主库的日志,

bc2ff3bb3c9ec90f1cc5b6872b12ff92.png

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值