• MySQL PXC集群大事务提交超限


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

    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.
  • 相关阅读:
    C# 16进制字节转Int(涉及:Base64转byte数组)
    c# CRC-16 / MODBUS 校验计算方法 及 异或校验算法
    SqlSugar 用法大全
    SQL Server-聚焦NOLOCK、UPDLOCK、HOLDLOCK、READPAST你弄懂多少?
    使用 tabindex 配合 focus-within 巧妙实现父选择器
    DataX 3.0 源码解析一
    Golang必备技巧:接口型函数
    PID控制
    dockerfile,拷贝文件夹到镜像中(不是拷贝文件夹中的内容到镜像)
    什么是PKI?主要作用是什么?
  • 原文地址:https://www.cnblogs.com/likingzi/p/16637339.html
Copyright © 2020-2023  润新知