8.4 中文镜像

MySQL 8.4 参考手册 · 中文镜像

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

打开官方英文原文 ↗

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

MySQL 8.4 参考手册 / 19 复制 / 19.5 复制注释和技巧 / 19.5.2 MySQL 版本之间的复制兼容性
中文点击中文段落可显示 / 隐藏英文原文本页译文覆盖 100%

19.5.2 MySQL 版本之间的复制兼容性19.5.2 Replication Compatibility Between MySQL Versions

MySQL 支持从旧版本源复制到新版本副本,对于我们支持从源版本升级到副本版本的版本组合,如 第 1.3 节,“MySQL 发布:创新与长期支持” 和 第 3.2 节,“升级路径” 所述。然而,如果源使用的语句或依赖于副本所用 MySQL 版本不再支持的行为,在从旧源复制到新副本时可能会遇到困难。MySQL supports replication from an older source to a newer replica for version combinations where we support upgrades from the source version to the replica version as described at Section 1.3, “MySQL Releases: Innovation and LTS” and Section 3.2, “Upgrade Paths”. However, you might encounter difficulties when replicating from an older source to a newer replica if the source uses statements or relies on behavior no longer supported in the version of MySQL used on the replica.

在涉及多个源的复制设置中,不支持使用多于两个 MySQL 服务器版本,无论源或副本 MySQL 服务器的数量如何。例如,如果您使用链式或循环复制设置,则不能同时使用 MySQL X.Y.1、MySQL X.Y.2 和 MySQL X.Y.3,但可以同时使用其中的任意两个版本。The use of more than two MySQL Server versions is not supported in replication setups involving multiple sources, regardless of the number of source or replica MySQL servers. For example, if you are using a chained or circular replication setup, you cannot use MySQL X.Y.1, MySQL X.Y.2, and MySQL X.Y.3 concurrently, although you could use any two of these releases together.

Important

强烈建议在给定的 MySQL 版本系列中使用可用的最新版本,因为复制(以及其他)功能不断改进。还建议在该版本系列的 GA(生产)版本可用时,将使用早期版本的源和副本升级到生产版本。It is strongly recommended to use the most recent release available within a given MySQL release series because replication (and other) capabilities are continually being improved. It is also recommended to upgrade sources and replicas that use early releases of a release series of MySQL to GA (production) releases when the latter become available for that release series.

服务器版本会记录在每个事务的二进制日志中,包括最初提交事务的服务器(original_server_version)以及当前服务器在复制拓扑中直接来源的服务器(immediate_server_version)。The server version is recorded in the binary log for each transaction for the server that originally committed the transaction (original_server_version), and for the server that is the immediate source of the current server in the replication topology (immediate_server_version).

从较新来源向较旧副本进行复制可能是可行的,但通常不被支持。这是由于多个因素造成的:Replication from newer sources to older replicas might be possible, but is generally not supported. This is due to a number of factors:

  • 二进制日志格式的变化。 二进制日志格式在主要版本之间可能会发生变化。虽然我们尽量保持向后兼容,但这并不总是可能的。源服务器可能还启用了较老副本无法理解的可选功能,例如二进制日志事务压缩,其中生成的压缩事务负载无法被早于 MySQL 8.0.20 版本的副本读取。Binary log format changes.  The binary log format can change between major releases. While we attempt to maintain backward compatibility, this is not always possible. A source might also have optional features enabled that are not understood by older replicas, such as binary log transaction compression, where the resulting compressed transaction payloads cannot be read by a replica from a release prior to MySQL 8.0.20.

    这对升级复制服务器也有重大影响;更多信息请参见 第 19.5.3 节,“升级或降级复制拓扑”。This also has significant implications for upgrading replication servers; see Section 19.5.3, “Upgrading or Downgrading a Replication Topology”, for more information.

  • SQL 不兼容性。 如果要复制的语句使用了源端有但副本端没有的 SQL 功能,则无法使用基于语句的复制方式从更新的源复制到较旧的副本。SQL incompatibilities.  You cannot replicate from a newer source to an older replica using statement-based replication if the statements to be replicated use SQL features available on the source but not on the replica.

    然而,如果源和副本都支持基于行的复制,并且要复制的数据定义语句不依赖于副本没有的源端 SQL 功能,则即使在源端运行的 DDL 在副本上不被支持,也可以使用基于行的复制来复制数据修改语句的效果。However, if both the source and the replica support row-based replication, and there are no data definition statements to be replicated that depend on SQL features found on the source but not on the replica, you can use row-based replication to replicate the effects of data modification statements even if the DDL run on the source is not supported on the replica.

    有关基于行的复制的更多信息,请参阅 第 19.2.1 节,“复制格式”。For more information about row-based replication, see Section 19.2.1, “Replication Formats”.

有关潜在复制问题的更多信息,请参阅 第 19.5.1 节,“复制功能和问题”。For more information on potential replication issues, see Section 19.5.1, “Replication Features and Issues”.