8.4 中文镜像

MySQL 8.4 参考手册 · 中文镜像

正文为中文,英文原文默认隐藏。点击任意中文段落即可展开 / 收起对应英文原文。

打开官方英文原文 ↗

译文由机器翻译生成,仅供理解参考;有疑问请以官方英文原文为准。

MySQL 8.4 参考手册 / 19 复制 / 19.5 复制注释和技巧 / 19.5.5 如何报告复制错误或问题
中文点击中文段落可显示 / 隐藏英文原文本页译文覆盖 100%

19.5.5 如何报告复制错误或问题19.5.5 How to Report Replication Bugs or Problems

当您确定不存在用户错误,并且复制仍然完全不工作或不稳定时,就该向我们发送错误报告了。我们需要从您那里获取尽可能多的信息,以便追踪错误。请花一些时间和精力准备一个好的错误报告。When you have determined that there is no user error involved, and replication still either does not work at all or is unstable, it is time to send us a bug report. We need to obtain as much information as possible from you to be able to track down the bug. Please spend some time and effort in preparing a good bug report.

如果您有一个可以重复的测试用例来演示该错误,请按照 第 1.6 节,“如何报告错误或问题” 中给出的说明将其输入我们的错误数据库。如果您遇到的是 “幻影” 问题(无法随意重复出现的问题),请使用以下程序:If you have a repeatable test case that demonstrates the bug, please enter it into our bugs database using the instructions given in Section 1.6, “How to Report Bugs or Problems”. If you have a “phantom” problem (one that you cannot duplicate at will), use the following procedure:

  1. 确认没有用户错误。例如,如果您在复制线程之外更新副本,数据会失去同步,并且在更新时可能出现唯一键冲突。在这种情况下,复制线程会停止并等待您手动清理表以使其同步。这不是复制问题。这是外部干扰导致复制失败的问题。Verify that no user error is involved. For example, if you update the replica outside of the replication threads, the data goes out of synchrony, and you can have unique key violations on updates. In this case, the replication thread stops and waits for you to clean up the tables manually to bring them into synchrony. This is not a replication problem. It is a problem of outside interference causing replication to fail.

  2. 确保副本在启用二进制日志记录的情况下运行(log_bin 系统变量),并启用 --log-replica-updates 选项,这会导致副本将从源接收到的更新记录到自己的二进制日志中。这些设置是默认设置。Ensure that the replica is running with binary logging enabled (the log_bin system variable), and with the --log-replica-updates option enabled, which causes the replica to log the updates that it receives from the source into its own binary logs. These settings are the defaults.

  3. 在重置复制状态之前保存所有证据。如果我们没有信息或只有零散信息,我们就很难甚至无法追踪问题。你应该收集的证据是:Save all evidence before resetting the replication state. If we have no information or only sketchy information, it becomes difficult or impossible for us to track down the problem. The evidence you should collect is:

    • 来自源的所有二进制日志文件All binary log files from the source

    • 来自副本的所有二进制日志文件All binary log files from the replica

    • 在您发现问题时,来自源的 SHOW BINARY LOG STATUS 输出The output of SHOW BINARY LOG STATUS from the source at the time you discovered the problem

    • 在您发现问题时,来自副本的 SHOW REPLICA STATUS 输出The output of SHOW REPLICA STATUS from the replica at the time you discovered the problem

    • 来自源和副本的错误日志Error logs from the source and the replica

  4. 使用 mysqlbinlog 来检查二进制日志。以下内容应有助于找到问题语句。 log_file 和 log_pos 是来自 SHOW REPLICA STATUS 的 Master_Log_File 和 Read_Master_Log_Pos 值。Use mysqlbinlog to examine the binary logs. The following should be helpful to find the problem statement. log_file and log_pos are the Master_Log_File and Read_Master_Log_Pos values from SHOW REPLICA STATUS.

    $> mysqlbinlog --start-position=log_pos log_file | head
    

在收集了问题的证据之后,先尝试将其作为一个独立的测试用例隔离出来。然后按照第 1.6 节,“如何报告错误或问题”中的说明,将问题以及尽可能多的信息输入我们的错误数据库。After you have collected the evidence for the problem, try to isolate it as a separate test case first. Then enter the problem with as much information as possible into our bugs database using the instructions at Section 1.6, “How to Report Bugs or Problems”.