背景
- 主库承担写请求,在深圳机房;从库承担读请求,在南京机房。
- 主从库均在DMP(数据库管理平台)进行管理。
- 主从数据通过Otter进行同步。
- 主从实例开启半同步配置。
基础环境
OS: CentOS Linux release 7.8.2003 (Core)
MySQL:5.7.13
Otter:4.2.18
DMP:2.7.12
故障现象
数据同步服务停止,zabbix告警: job dead desc: Error 1290: The MySQL server is running with the --super-read-only option so it cannot execute this statement
故障定位
分析错误日志
查看主库mysql-error.log发现有如下信息:
1、主库的semi-sync在崩溃前做了启停动作:
2019-11-25T16:02:38.636061+08:00 40 [Note] Semi-sync replication switched OFF.
2019-11-25T16:02:38.636105+08:00 40 [Note] Semi-sync replication disabled on the master.
2019-11-25T16:02:38.636137+08:00 0 [Note] Stopping ack receiver thread
2019-11-25T16:02:38.638008+08:00 40 [Note] Semi-sync replication enabled on the master.
2019-11-25T16:02:38.638131+08:00 0 [Note] Starting ack receiver thread
2、主库的semi-sync启动后,立即引发了semi-sync插件崩溃并抛出Assert异常。
mysqld: /export/home/pb2/build/sb_0-19016729-1464157976.67/mysql-5.7.13s/plugin/semisync/semisync_master.cc:844: int ReplSemiSyncMaster::commitTrx(const char*, my_off_t): Assertion `entry' failed.
08:02:38 UTC - mysqld got signal 6 ;
3、这里还有一个相当重要的复现故障的线索。简单说明一下,这条SQL语句是为了检测主从数据差,而由高可用中间件不断地向数据库更新时间戳。
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (7f408c0054c0): update universe.u_delay set real_timestamp=now(), logic_timestamp = logic_timestamp + 1 where source = 'ustats'
Connection ID (thread ID)