大家都知道,MySQL 的各参数很多,设置不恰当,会引起各种异常;
本文根据一则实际生产异常场景,即从库的同步异常报错Last_Errno: 1864,来介绍slave_pending_jobs_size_max参数的调整。
问题现象描述
生产环境上从库出现SQL进程停止的异常,错误信息如下:
mysql> show slave status \G; *************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: 192.168.0.11
Master_User: replica_01
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.004783
Read_Master_Log_Pos: 3681586
Relay_Log_File: DB2-relay-bin.000007
Relay_Log_Pos: 671091671
Relay_Master_Log_File: mysql-bin.004782
Slave_IO_Running: Yes
Slave_SQL_Running: No
Replicate_Do_DB:
Replicate_Ignore_DB:
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno: 1864
Last_Error: Cannot schedule event Update_rows, relay-log name ./DB2-relay-bin.000007, position 671094876 to Worker thread because its size 50450016 exceeds 16777216 of slave_pending_jobs_size_max.
Skip_Counter: 0
Exec_Master_Log_Pos: 671091458