美文网首页
MySQL:最近遇到的几个BUG

MySQL:最近遇到的几个BUG

作者: 重庆八怪 | 来源:发表于2023-01-17 15:10 被阅读0次

    一、insert undo 导致crash BUG

    8.0.22 使用 create table A select B 后,当B表越来越大,insert undo 如果到达truncate设置大小,有机会触发crash BUG。虽然insert undo 相比 update/delete undo比较小,值记录了主键,但是如果表本身很大,undo大小也是会超过truncate设置的。而insert undo 并不是purge线程清理的而是session线程自己清理的。

    本BUG因为insert undo 可能由于purge线程truncate后导致本session在清理的时候找不page。BUG如下:

        Bug#33162828: INNODB: Assertion failure: ut0ut.cc:552 thread 140294520874752
    
        Problem:
        Server crashes when an undo tablespace is truncated while
        an active transaction is using it.
    
        Solution:
        Do not mark the transaction as complete until all the cleanup is done.
    
    

    修复版本为8.0.27

    InnoDB: Truncation of an undo tablespace during use by an active transaction raised an assertion failure. The transaction was prematurely marked as complete, permitting the truncation operation. (Bug #33162828)

    二、MTS 并发hang死BUG

    https://bugs.mysql.com/bug.php?id=103636

    这个BUG 8.0.28 修复,看起来是MTS 和参数slave_preserve_commit_order有关,而Commit_order_manager类作为管理从库提交顺序的数据结构,其中在处理的时候某个局部变量为unsigned int,应该使用类型unsigned long long,导致了翟卫唤醒不了woker线程的BUG。这个BUG由印风提交并且修复。

    三、change buffer 问题导致crash BUG

    这个BUG 8.0.21和5.7.31修复,会导致crash

    https://bugs.mysql.com/bug.php?id=104850,具体描述如下,没有过多分析:

    image.png

    如果遇到在SSD的情况下可以考虑关闭change buffer。

    四、主从自增丢失的BUG

    这个BUG主要发生在5.7时代,
    https://bugs.mysql.com/bug.php?id=73563

    更新(update)主键自增值不会增加,导致主从切换后主键值冲突。这个问题同样存在于replace到从库上的更新因为row格式的binlog在从库应用的时候使用的是update,导致主键更新丢失自增,replace在主库是delete event/insert event。

    因此尽量少用replace/insert on duplicate等语句。

    相关文章

      网友评论

          本文标题:MySQL:最近遇到的几个BUG

          本文链接:https://www.haomeiwen.com/subject/vznthdtx.html