MySQL PXC集群大事务提交超限

2022年6月15日 604点热度 1人点赞 0条评论

研发人员在测试大事务提交时遇见了错误:

Got error 5 - 'Transaction size exceed set threshold' during COMMIT

测试了几次都是1200S的时候停止的,不过在注释掉特定步骤后,过程还是在1200S失去连接了,不知道这个1200S的执行参数是哪个,可能这个1200s的执行参数是关键,因为看 wsrep_max_ws_size 最大提交量是2G,理论上应该是够用的。
通过以下查询方式,也只能查出这个2G的限制:

show variables like '%max%';
show variables like '%timeout%';
select @@wsrep_max_ws_size;
show variables where variable_name like '%size%';
show variables where value like '%1200%';
show status where value like '%1200%';

没找到如何设置1200S这个超时限制。
因此建议研发人员用如下方式临时设置 max_ws_size 参数:

set global wsrep_max_ws_size=1024*1024*1024*4;

然后重连数据库,再次测试一下大事务是否有效,如果有效的话,可择机改数据库配置。
另,强烈建议修改提交逻辑,减小每次事务提交大小,控制在1G以内,因为在1G-2G之间,按照官方说法,可能回遭遇bug。
附录:以下是在官方社区的提问及回复。

社区提问:
When I execute my proceduer, 1200 seconds later, I got an error like this:
Got error 5 - 'Transaction size exceed set threshold' during COMMIT
wsrep_max_ws_size
mysql> select @@wsrep_max_ws_size;
+---------------------+
| @@wsrep_max_ws_size |
+---------------------+
|          2147483647 |
+---------------------+
But my trx size is small, less than 2G.
Is there some other limits about the “Transaction size” in PXC 8.0 ?
Where can I set the timeout more than 1200 seconds?
Thanks a lot.
官方回复:
Is your transaction less than 2GB but larger than 1GB? If so, you might be hitting some internal C function limitations that can’t handle data objects larger than 1GB.
Since you are using PXC 8, you should take a look at the new streaming transaction option available.

liking

这个人很懒,什么都没留下

文章评论