GreatSQL社区

搜索

mysql5.7.25 动不动挂掉,怎么排查什么sql 触发数据库bug 导致

622 1 2023-9-27 18:50

mysql5.7.25 动不动挂掉,怎么排查什么sql 触发数据库bug 导致重启

END OF INNODB MONITOR OUTPUT
============================
InnoDB: ###### Diagnostic info printed to the standard error stream
2023-09-27T18:14:33.329404+08:00 0 [ERROR] [FATAL] InnoDB: Semaphore wait has lasted > 600 seconds. We intentionally crash the server because it appears to be hung.
2023-09-27 18:14:33 0x7f2ae499e700  InnoDB: Assertion failure in thread 139822200645376 in file ut0ut.cc line 942
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/ ... nnodb-recovery.html
InnoDB: about forcing recovery.
10:14:33 UTC - mysqld got signal 6 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
Attempting to collect some information that could help diagnose the problem.
As this is a crash and something is definitely wrong, the information
collection process might fail.

key_buffer_size=33554432
read_buffer_size=8388608
max_used_connections=1098
max_threads=5000
thread_count=1094
connection_count=1094
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 51299682 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

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 0x40000
/usr/local/mysql/bin/mysqld(my_print_stacktrace+0x35)[0xf4f775]
/usr/local/mysql/bin/mysqld(handle_fatal_signal+0x4a4)[0x7d1d24]
/lib64/libpthread.so.0[0x3c5a80f710]
/lib64/libc.so.6(gsignal+0x35)[0x3c5a432625]
/lib64/libc.so.6(abort+0x175)[0x3c5a433e05]
/usr/local/mysql/bin/mysqld(_Z18ut_print_timestampP8_IO_FILE+0x0)[0x7c10ee]
/usr/local/mysql/bin/mysqld(_ZN2ib5fatalD1Ev+0xb3)[0x10eb123]
/usr/local/mysql/bin/mysqld(srv_error_monitor_thread+0x98e)[0x109bdce]
/lib64/libpthread.so.0[0x3c5a8079d1]
/lib64/libc.so.6(clone+0x6d)[0x3c5a4e89dd]
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.
2023-09-27T10:14:34.034011Z mysqld_safe Number of processes running now: 0
2023-09-27T10:14:34.040755Z mysqld_safe mysqld restarted

全部回复(1)
张旭峰 2023-9-28 10:21:46
show processlist ;show engine innodb status\G;信息抓取下
看下 select语句有没有全表扫描的,一直占用Latch没有释放
看挂掉时间段的binlog里面的语句 慢查询的语句 ;

这类问题的发生多数都是因为SQL写的不好,在表上面进行了大量的全表扫描占用了大量的Latch,
解决方案就是避免SQL长时间占用Latch:
1,修改select查询避免全表扫描,避免Latch长期被占用。
2,适当的加索引,让select执行更快,也避免一个select锁的数据更少。
3,适当加大buffer pool instance,每个buffer pool都有自己独立的Latch,避免latch竞争。
马天艺

3

主题

0

博客

14

贡献

新手上路

Rank: 1

积分
25

合作电话:010-64087828

社区邮箱:greatsql@greatdb.com

社区公众号
社区小助手
QQ群
GMT+8, 2024-12-31 00:41 , Processed in 0.017449 second(s), 10 queries , Redis On.
快速回复 返回顶部 返回列表