故障分析 | MySQL : slave_compressed_protocol 导致 crash

本文详细记录了一个在MySQL 8.0.18环境中,半同步复制配合大对象(longblob)插入及slave_compressed_protocol参数导致的服务器崩溃问题的排查过程。作者通过复现问题、关闭延迟检测、分析影响因素,最终发现三个触发条件:插入longblob大对象、半同步复制以及slave_compressed_protocol设置为on。关闭slave_compressed_protocol参数后问题得到解决。文章还提到了相关官方bug及解决方案。

作者:胡呈清

爱可生 DBA 团队成员,擅长故障分析、性能优化,个人博客:https://www.jianshu.com/u/a95ec11f67a8,欢迎讨论。

本文来源:原创投稿

*爱可生开源社区出品,原创内容未经授权不得随意使用,转载请联系小编并注明来源。


现象

MySQL版本:8.0.18

create.sql:zabbix 初始化脚本,包含建表、插入数据语句,10M+大小

一个新客户,部署了一套我司的数据库管理平台,接管进来一主两从实例,其中一主一从在无锡机房,为半同步复制,另一个从库在北京机房,为异步复制。当在主库上 source create.sql 时,会 crash。但没接管进平台前,不会出现 crash。

说明:这里提到的管理平台,不会影响理解整篇文章。

排查过程

1. 在测试环境进行复现

为方便排查,需要在可控的环境下进行复现:

  • 与客户相同的 my.cnf
  • 相同的 MySQL 版本
  • 相同的复制架构
  • 执行相同的 create.sql

确实可以稳定复现 crash,error log 如下:

2020-04-28T17:51:47.441886+08:00 0 [ERROR] [MY-013129] [Server] A message intended for a client cannot be sent there as no client-session is attached. Therefore, we’re sending the information to the error-log instead: MY-001158 - Got an error reading communication packets

09:51:47 UTC - mysqld got signal 11 ;

Most likely, you have hit a bug, but this error can also be caused by malfunctioning hardware.

Thread pointer: 0x0

Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong…

stack_bottom = 0 thread_stack 0x46000

2020-04-28T17:51:47.447907+08:00 218 [ERROR] [MY-011161] [Server] Semi-sync master failed on net_flush() before waiting for slave reply.

/opt/mysql/base/8.0.18/bin/mysqld(my_pr

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值