MariaDB 版本之间的 Gtid 位置差异 [英] Gtid Position difference between MariaDB version

查看:53
本文介绍了MariaDB 版本之间的 Gtid 位置差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的项目中将 MariaDB 从 10.2.18 升级到 10.2.27 期间,我在我们的项目中遇到了问题,这导致了数据库复制启动期间的问题.

I got an issue in our project during the MariaDB upgrade from 10.2.18 to 10.2.27 in my project, which caused problem during the start of Database Replication.

在分析时,我可以在 MariaDB 安装过程中看到一个奇怪的行为,下面是 my.cnf.

On analyzing, I could see a weird behavior during MariaDB Installation with the below my.cnf.

我尝试使用以下简化的 my.cnf 文件通过 shell 脚本尽可能简单地重现该场景.

I tried to reproduce the scenario as simple as possible by a shell script with the below simplified my.cnf file.

[mysqld]
server-id=1
log-bin=binary-log.
binlog-ignore-db=mysql
binlog-ignore-db=performance_schema

从那里我可以看到 v10.2.18 中 gtid_positions 的输出差异,其中前 3 个位置为空,而在 v10.2.27 中它有 0-1-1.

from where I could see the difference in the output of gtid_positions in v10.2.18 where first 3 positions are null while in v10.2.27 it has 0-1-1.

代码:https://jira.mariadb.org/secure/attachment/49300/mariaTest.sh

输出:https://jira.mariadb.org/secure/attachment/49299/49299_DifferenceInPositionsBWTwoVersions.png

作为我分析的一部分,我只有在添加log-bin=binary-log"后才能看到上述差异.我的 cnf 文件中的属性.虽然没有财产,我看不到上述差异.对添加此属性后的行为感到困惑.

As part of my analysis, I could see the above difference only after adding "log-bin=binary-log." properties in my cnf file. while without the property I could not see the above difference. Confused about the behavior after adding this property.

您能否澄清上述行为?为什么添加log-bin"后会影响位置?

Can you please clarify the above behavior? Why the position get affected after adding "log-bin"?

或者我在 my.cnf 文件中做错了什么?

Or Is there any mistake I am doing in the my.cnf file?

推荐答案

提出与 MariaDB 票证相同的问题 https://jira.mariadb.org/browse/MDEV-20990

Raised the same question as MariaDB ticket https://jira.mariadb.org/browse/MDEV-20990

在读取 binlog 时,我们可以看到在 10.2.27 MariaDB 安装开始时考虑了 DDL 事务(创建了一个测试数据库)......而在 10.2.18 MariaDB 中没有考虑.

On reading the binlog, we could see a DDL transaction is considered at the start of the installation for 10.2.27 MariaDB (created a test database) ...while it is not considered in 10.2.18 MariaDB.

根据评论,是的,由于修复了 MDEV-17640,MariaDB 最新版本中似乎存在上述差异.

As per the comment, yes the above difference seems to be expected in the MariaDB latest version due to the fix MDEV-17640.

已解决:在 my.cnf 文件中添加了用于复制忽略的测试数据库

Solved: Added test DB for replication ignore with below property in my.cnf file

***binlog-ignore-db = test***

这篇关于MariaDB 版本之间的 Gtid 位置差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆