GreatSQL社区

搜索

[已解决] 长事务导致MySQL MGR集群异常

279 2 2024-1-11 17:08
数据库版本:MySQL社区版 8.0.26
MGR相关参数:
group_replication_communication_max_message_size =10485760
group_replication_compression_threshold=1000000
group_replication_member_expel_timeout=5
group_replication_single_primary_mode=ON
group_replication_transaction_size_limit=750000000

背景:MySQL MGR 3节点集群,单主模式,存在需要使用insert into  table select  复制数据的需求。
模拟SQL如下
insert into t1(c1,c2,c3,c4,c5,c6,c7) select c1,c2,c3,c4,c5,c6,c7 from t2

表t2 大小约为500MB,索引大小约为300MB。
MySQL error 日志如下
2024-01-05T11:18:02.522297+08:00 0 [Warning] [MY-011493] [Repl] Plugin group_replication reported: 'Member with address 192.168.1.10:7778 has become unreachable.'
2024-01-05T11:18:03.897471+08:00 0 [Warning] [MY-011494] [Repl] Plugin group_replication reported: 'Member with address 192.168.1.10:7778 is reachable again.'
2024-01-05T11:18:11.493942+08:00 0 [Warning] [MY-011735] [Repl] Plugin group_replication reported: '[GCS] Shutting down an outgoing connection. This happens because something might be wrong on a bi-directional connection to node 192.168.1.10:17778. Please check the connection status to this member'
2024-01-05T11:18:50.316212+08:00 0 [Warning] [MY-011493] [Repl] Plugin group_replication reported: 'Member with address 192.168.1.10:7778 has become unreachable.'
2024-01-05T11:18:51.331608+08:00 0 [Warning] [MY-011494] [Repl] Plugin group_replication reported: 'Member with address 192.168.1.10:7778 is reachableagain.'
2024-01-05T11:19:01.280893+08:00 0 [Warning] [MY-011493] [Repl] Plugin group_replication reported: 'Member with address 192.168.1.11:7778 has become unreachable.'

通过 select * from performance_schema.replication_group_members 查看所有成员的member_state都为online。但此时其他表的数据无法写入。
通过 mysql client 执行kill 命令,操作后,事务长时间处理 killed的状态,但无法真正的结束,此时集群状态查询,原主节点为 unreachable,其他节点为online。无法重新选举出主节点。通过 kill -9 在服务器层面上强制kill 主节点,观察两个从节点的状态,观察时间超过2个小时,依旧无法恢复正常。

问题如下
1.长事务是如何影响MySQL MGR的集群的通信?
2.官方文档写数据包应该会按照10MB大小分片的发送,为什么集群通信还是受到的影响?
3.主节点kill掉后的时间里,两个从节点在做什么?为什么无法选举?

全部回复(2)
Guoxing

1

主题

0

博客

3

贡献

新手上路

Rank: 1

积分
4

合作电话:010-64087828

社区邮箱:greatsql@greatdb.com

社区公众号
社区小助手
QQ群
GMT+8, 2024-5-19 20:57 , Processed in 0.017113 second(s), 14 queries , Redis On.
快速回复 返回顶部 返回列表