1. Relay log read failure

  1. # 错误信息
  2. Relay log read failure: Could not parse relay log event entry. The possible reasons are:
  3. the master's binary log is corrupted (you can check this by running 'mysqlbinlog' on the binary log),
  4. the slave's relay log is corrupted (you can check this by running 'mysqlbinlog' on the relay log),
  5. a network problem, or a bug in the master's or slave's MySQL code. If you want to check the master's
  6. binary log or slave's relay log, you will be able to know their names by issuing 'SHOW SLAVE STATUS' on this slave.
  7. # 原因
  8. 在传输master log-bin时,因网络原因或slave机压力问题,造成log-relay文件格式错误
  9. # 解决方法一:
  10. 找到relay-log.info,第一行记录了当前正在执行的log-relay文件名
  11. 找到该文件的下一个文件
  12. 使用mysqlbinlog查看该文件,在#98这行有Rotate to log-bin.000004 pos: 4等信息,这就是目前slave停止的位置
  13. slave上重新指定同步位置,重新执行:
  14. change master to
  15. master_host='1.1.1.1',
  16. master_user='repl',
  17. master_password='111111',
  18. master_port=3306,
  19. master_log_file='log-bin.000004',
  20. master_log_pos=4;
  21. slave start;
  22. show slave status\G;
  23. # 解决方法二
  24. 解决方法二:
  25. stop slave之后,重新reset slave

mysql主从复制,从实例出现Executed_Gtid_Setgtid相较于主库有缺失

image.png
当前主库GTID为f0d21923-944b-11ec-b134-fa163ead8820:1-18
从库GTID为f0d21923-944b-11ec-b134-fa163ead8820:17-18
从库相较于主库缺失1-16的GTID记录

可能产生的原因:
备库执行reset mastergtid被重置,重新start slaveio线程从上一次的relaylog开始向主库拉取binlog日志,sql线程继续回放新的relaylog,从而导致gtid相较于主库有缺失