暂无图片
mysql mgr group_replication_consistency默认为EVENTUAL,但是实际还是等待了之前的事务apply完毕才提供写功能
我来答
分享
StartupForce
2020-12-15
mysql mgr group_replication_consistency默认为EVENTUAL,但是实际还是等待了之前的事务apply完毕才提供写功能

group_replication_consistency参数为EVENTUAL时,RO和RW事务都不等待执行之前的事务。但是我实际测试会呢,在压测期间,stop group_replication后,其中要给secondary变成primary,而在该primary上执行创建表操作报错,说super_read_only开启了,确实是开启的 。这就不能写了,跟官方文档表述不一样呢?
官方文档关于该参数说明

EVENTUAL

Both RO and RW transactions do not wait for preceding transactions to be applied before executing. This was the behavior of Group Replication before the group_replication_consistency variable was added. A RW transaction does not wait for other members to apply a transaction. This means that a transaction could be externalized on one member before the others. This also means that in the event of a primary failover, the new primary can accept new RO and RW transactions before the previous primary transactions are all applied. RO transactions could result in outdated values, RW transactions could result in a rollback due to conflicts.

实际新选primary日志也表述会在应用完所有日之后才 开启写,如下:
16:04 mgrb02离开集群,他是primary
16:04 开始选举新的primary
16:05 mgrb01为新的primary,并且说明:The new primary will execute all previous group transactions before allowing writes
28:57 12分钟后,mgrb01关闭super_read_only开始 提供写功能。io较差,压测比较厉害,所以时间这么长。

2020-12-15T07:16:04.098052Z 0 [Warning] [MY-011499] [Repl] Plugin group_replication reported: 'Members removed from the group: mgrb02:3308'
2020-12-15T07:16:04.098147Z 0 [System] [MY-011500] [Repl] Plugin group_replication reported: 'Primary server with address mgrb02:3308 left the group. Electing new Primary.'
2020-12-15T07:16:05.099153Z 0 [System] [MY-011507] [Repl] Plugin group_replication reported: 'A new primary with address mgrb01:3308 was elected. The new primary will execute all previous group transactions before allowing writes.'
2020-12-15T07:16:05.099671Z 0 [System] [MY-011503] [Repl] Plugin group_replication reported: 'Group membership changed to mgrb01:3308, mgrb03:3306 on view 16075037194539719:48.'
2020-12-15T07:28:57.125015Z 8261 [System] [MY-011566] [Repl] Plugin group_replication reported: 'Setting super_read_only=OFF.'
2020-12-15T07:28:57.126748Z 8261 [System] [MY-011510] [Repl] Plugin group_replication reported: 'This server is working as primary member.'

复制
我来答
添加附件
收藏
分享
问题补充
2条回答
默认
最新
Cui Hulong

1.EVENTUAL翻译下来 意思就是 开启该级别的事务(T2),事务执行前不会等待先序事务(T1)的回放完成,也不会影响后序事务等待该事务回放完成。
2.这部分也是验证过的。可能也存在一些缺陷
3.看下面实际测试情况,因为切换机制导致,出现read onley末及时切换情况。是不是要找个好的服务器再测试看看。

暂无图片 评论
暂无图片 有用 0
打赏 0
StartupForce

我有一个跟他几乎同步的机器,在切换时日志也会提示这个:The new primary will execute all previous group transactions before allowing writes

也就是在之前组的事务没有应用完成之前是不能写入的。感觉跟机器好坏没关系哦,他就是切换的时候要把之前组的事务应用完成才会将super_read_only关闭,然后提供写功能。

暂无图片 评论
暂无图片 有用 0
打赏 0
回答交流
Markdown


请输入正文
提交
相关推荐
mysql 5.5支持innodb存储引擎吗?
回答 1
已采纳
支持。MySQL5.5版本以后,默认存储引擎由 MyISAM修改为InnoDB。
请教一下 MySQL-Cluster8.0怎么设置sql_mode属性啊? 用命令设置重启就失效了
回答 1
写到参数文件里面
mysql的binlog不到一天就填满磁盘,做自动清除,影响数据的稳定性吗?
回答 3
不影响系统稳定性,但是如果一天多次清理binlog,尽量做好备份吧。不然出现数据丢失,没有binlog的话,很麻烦。
Mysql的默认事物怎么修改?
回答 1
已采纳
settransactionisolation'REPEATABLEREAD';settransactionisolation'ReadCommitted';不同的隔离级别。效果不一样。rr模式下,没
有哪位可以帮我解答下udev规则?KERNEL=="dm-*",ENV{DM_UUID}=="mpath-222020001551e58d8",OWNER="grid",GROUP="asmadmin",MODE="0660"这个规则改不了权限
回答 3
multipath多路径可以参考这样的写法,要用12,用mapper出来的盘符名绑定即可cat/etc/udev/rules.d/12dmpermissions.rulesENV{DMNAME}“da
binlog2sql:支持远程数据库吗?
回答 1
貌似本地
关于mysql分表,如何将大表分成多个小表?
回答 1
已采纳
其实在数据库中1000万以下都是小表。上亿也不是问题。只要不是全表都很快。毫秒级别。完全没有必要分表。
用Navicat连接MySQL,存储过程自动没有,导入时仍然提示该存储过程存在?
回答 2
有可能是权限问题,图1与图2的用户是否一致?
mysql哪个版本可以做集群的?
回答 1
我记得MySQL5.7.16开始就引入了groupreplication了。但是5.7.22以下据我了解非常不稳定。个人测试目前mysql8.0mgr相对比较稳定了。我们也有一些客户在陆续上MySQL
OGG同步Mysql抽取进程中断无报错生成
回答 1
给你ChatGPT搜了一下,你可以参考看看检查连接稳定性:确保源数据库和目标数据库之间的网络连接是稳定的,并且没有任何网络问题导致抽取进程中断。检查网络连接是否频繁断开或出现延迟,并尝试解决任何与网络