不要升级到 MySQL 8.0.37 之后的任何版本,有重大BUG


不要升级到 MySQL 8.0.37 之后的任何版本,有重大BUG

警告!

最近,Jean-François Gagné 在 bug.mysql.com 上开了一个编号为 #115517 的 bug;不幸的是,该 bug 现在是私有的。
然而,这个 bug 看起来相当严重。我们在 Percona 进行了几次测试,并开了一个问题 PS-9306 来调查这个问题。
简而言之,问题出在如果你创建了大量的表,比如 10000 个,mysql 守护进程在重新启动时会崩溃。
目前,我们已经确认以下版本受影响:
MySQL 8.0.38
MySQL 8.4.1
MySQL 9.0.0


我们还没有找到根本原因或解决方法。因此,我们建议所有用户在修复发布之前不要采用上述任何 MySQL 版本。
如果你想自行测试,只需安装其中一种提到的 MySQL 版本,并运行类似于我们问题 PS-9306 中使用的脚本即可。


链接:https://www.percona.com/blog/do-not-upgrade-to-any-version-of-mysql-after-8-0-37/


测试验证:
本次使用Mysql 9.0.0 社区版做测试. 可使用如下脚本快速创建10001张表
MySQL版本:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 9.0.0 MySQL Community Server - GPL


Copyright (c) 2000, 2024, Oracle and/or its affiliates.


Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.


Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.


编写Python脚本,批量创建10001个表空表:
[root@centos7 ~]# cat create_tables.py 
import pymysql
conn = pymysql.connect(
host='127.0.0.1',
port=3306,
user='root',
password='Rscpass123.',
)


for i in range(10001):
cursor = conn.cursor()
#cursor.execute(f'drop table db1.t20240712_{i}')
cursor.execute(f'create table shukuinfo.t_test_{i}(id int, name varchar(10))')
data = cursor.fetchall()
conn.commit()


运行脚本:
[root@centos7 ~]# python3 ./create_tables.py 


验证是否已创建10001个表:
mysql> SELECT COUNT(*) FROM information_schema.`TABLES`   WHERE  TABLE_SCHEMA='shukuinfo';
+----------+
| COUNT(*) |
+----------+
|    10001 |
+----------+
1 row in set (0.06 sec)


这个时间如果不重新服务器,是可以正常使用的




然后重启mysqld进程. 我们就能在日志中发现如下crash信息
[root@centos7 ~]# systemctl restart mysqld
Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld.service" and "journalctl -xe" for details.


错误日志如下:
[root@centos7 ~]# cat /var/log/mysqld.log
2024-07-12T10:14:15Z UTC - mysqld got signal 11 ;
Signal SIGSEGV (Address not mapped to object) at address 0x508
Most likely, you have hit a bug, but this error can also be caused by malfunctioning hardware.
BuildID[sha1]=dfabd74bf52f1e837013253245e70e99363bf167
Thread pointer: 0x0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 0 thread_stack 0x100000
 #0 0x1053476 _ZL18print_fatal_signaliP9siginfo_t
 #1 0x10537ec _Z19handle_fatal_signaliP9siginfo_tPv
 #2 0x7f1c61a5362f <unknown>
 #3 0x221fd1e _ZN14Validate_files5checkERKN9__gnu_cxx17__normal_iteratorIPKPKN2dd10TablespaceESt6vectorIS5_SaIS5_EEEESD_m
 #4 0x2204ae7 _ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJ15Detached_threadSt8functionIFvRKN9__gnu_cxx17__normal_iteratorIPKPKN2dd10TablespaceESt6vectorISA_SaISA_EEEESI_mEESG_SG_mEEEEE6_M_runEv
 #5 0x2bfdf63 execute_native_thread_routine
 #6 0x7f1c61a4bea4 start_thread
 #7 0x7f1c5ff0db0c clone
 #8 0xffffffffffffffff <unknown>
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.


创建大量表时,MySQL将无法重启,进程会崩溃,希望官方会尽快修复这个BUG

分割线
感谢打赏
江西数库信息技术有限公司
YWSOS.COM 平台代运维解决方案
 评论
 发表评论
姓   名:

Powered by AKCMS