我们在MySQL5.7.23和5.7.24上多次看到这个问题。复制在出现错误时被冻结,我无法使用“stop slave;start slave;”手动重新启动它
我们的问题场景:
-
只读副本上的复制停止,错误为1205。
-
错误文本:
Coordinator stopped because there were error(s) in the worker(s). The most recent failure being: Worker 7 failed executing transaction 'ANONYMOUS' at master log mysql-bin.00xxxx, end_log_pos xxxxxxxxx. See error log and/or performance_schema.replication_applier_status_by_worker table for more details about this failure or others, if any.
-
在bin日志中,我看到一些普通的更新命令-我们一天中有很多更新命令。
-
检查
performance_schema.replication_applier_status_by_worker
显示如下错误:
"Worker 1 failed executing transaction 'ANONYMOUS' at master log mysql-bin.00xxxx, end_log_pos xxxxxxxxx; Lock wait timeout exceeded; try restarting transaction"
-
| 56327 | root | localhost | NULL | Query | 61716 | Killing slave | stop slave |
无限期运行
-
从Linux命令行手动重新启动实例不起作用。实例被冻结,我不能ssh它,我必须强制从Google GCE web gui重新启动。
-
在错误.log我可以看到一系列错误信息
Worker 7 failed executing transaction 'ANONYMOUS' at master log mysql-bin.00xxxx, end_log_pos xxxxxxxx; Could not execute Update_rows event on table xxxx.xxxx; Lock wait timeout exceeded; try restarting transaction, Error_code: 1205; handler error HA_ERR_LOCK_WAIT_TIMEOUT; the event's master log mysql-bin.00xxxx, end_log_pos xxxxxxxxx, Error_code: 1205
-
序列以错误消息结束:
worker thread retried transaction 10 time(s) in vain, giving up. Consider raising the value of the slave_transaction_retries variable. Error_code: 1205
我试着设置更高的变量
slave_transaction_retries
(至30)这降低了“冻结病例”的数量,但问题仍然存在。如果复制停止,我不能从mysql命令行工具手动重新启动它。
我们在5.7.22或更旧版本上的冻结复制没有这些问题。尽管由于我们在一天中进行了大量的更新,我们在复制过程中不时会遇到错误1205,但是从mysql命令行工具手动重新启动复制总是没有问题的。
在5.7.24上,情况似乎好了一点,在复制中进行了许多修复。在24日,我们看到这个问题的案例少得多,但它仍然存在。
-
我可以通过一些参数来影响这个行为吗?
-
如果此问题再次发生,您建议如何检查?
-
我可以在不重启MySQL的情况下强制重启冻结的复制吗?