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.'
复制