MySQL Error_code: 1756

电话告警故障:MySQL 从库异常宕机。

查看MySQL error日志:

[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

官网解释:

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. 意思如下: 这个等待状态会在什么时候发生呢?这个状态只会在slave_parallel_workers设置不为0时,当Workers处理的事件总大小超过了系统参数slave_pending_jobs_size_max设置的值。 当大小低于这个值时,调度器才会恢复调度。

查看数据库参数大小:slave_pending_jobs_size_max 默认值为16MB

复制代码
mysql> show variables like 'slave_pending_jobs_size_max';
+-----------------------------+----------+
| Variable_name               | Value    |
+-----------------------------+----------+
| slave_pending_jobs_size_max | 16777216 |
+-----------------------------+----------+
1 row in set (0.00 sec)

mysql> set global slave_pending_jobs_size_max = 134217728;
Query OK, 0 rows affected (0.00 sec)
复制代码
复制代码
mysql> show variables like 'max_allowed_packet';
+--------------------+------------+
| Variable_name      | Value      |
+--------------------+------------+
| max_allowed_packet | 573741824  |
+--------------------+------------+
1 row in set (0.00 sec)

mysql> set global max_allowed_packet = 1073741824;
Query OK, 0 rows affected (0.00 sec)
复制代码

最后将 slave_pending_jobs_size_max = 128M 写进配置文件中.

posted @   __Yoon  阅读(330)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· 葡萄城 AI 搜索升级:DeepSeek 加持,客户体验更智能
· 什么是nginx的强缓存和协商缓存
· 一文读懂知识蒸馏
历史上的今天:
2022-04-24 redis 内存碎片
点击右上角即可分享
微信分享提示