[MDEV-30125] "[ERROR] mysqld got signal 11 ;" only on AMD EPYC 7773X servers versus intel servers, and suspected poor performance/stability on AMD servers versus intel servers Created: 2022-11-29  Updated: 2023-02-20  Resolved: 2023-02-20

Status: Closed
Project: MariaDB Server
Component/s: N/A
Affects Version/s: 10.6.11
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: F K Assignee: Daniel Black
Resolution: Cannot Reproduce Votes: 1
Labels: None
Environment:

Red Hat Enterprise Linux release 8.7 (Ootpa)
MariaDB-server-10.6.11-1.el8.x86_64



 Description   

Hello,
We had exact same MariaDB data(copied from slaves as full binary), and synced on three intel servers and two AMD servers as slaves and one AMD server as master.
The three intel servers have different specs(lower than AMD) while the AMD are all dual EPYC 7773X with 1 TB of RAM.

Two major issues were noted only on AMD servers.

First of all we noticed the AMD servers have much poor performance compared to Intel servers(when used as master, the slave are really unneccessary and have little load), nearly being unresponsive with high load, while intel servers having much lower specs were much more stable(when used as master).
We noticed that it occurs exactly when the both CPUs are used due to load increase.
We tested in production with
kernel.numa_balancing=0

Then with
kernel.numa_balancing=1
and ExecStart=numactl --interleave=all /usr/sbin/mariadbd......

Both options had really poor performance exactly when the both CPUs are used due to load increase. Of note, we did not use such options on Intel servers, because we never had any problems, and didn't know of the recommendation of such options in MariaDB official documentation.

We had much better stability with
ExecStart=numactl --cpunodebind=1..... with or without interleave option.

Still we suspect in several metrics and stabililty during high load that the server has much more slow queries and spikes compared to intel servers.

Second of all, we ran optimize command on one large about 120GB tables on all of the 5 slaves.
All the intel servers finished relatively quickly, while ALL two AMD servers crashed with
[ERROR] mysqld got signal 11 ;

Here is the error log:

221129 16:48:25 [ERROR] mysqld got signal 11 ;
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.
 
To report this bug, see https://mariadb.com/kb/en/reporting-bugs
 
We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed, 
something is definitely wrong and this may fail.
 
Server version: 10.6.11-MariaDB-log
key_buffer_size=33554432
read_buffer_size=131072
max_used_connections=29
max_threads=65537
thread_count=13
It is possible that mysqld could use up to 
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 142902243 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.
 
Thread pointer: 0x7ef7fc0008e8
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 = 0x7efb1007bb18 thread_stack 0x49000
??:0(my_print_stacktrace)[0x564074e6533e]
??:0(handle_fatal_signal)[0x564074945295]
??:0(__restore_rt)[0x7f7c8e59ccf0]
??:0(void std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<char*>(char*, char*, std::forward_iterator_tag))[0x564074ccff0c]
??:0(void std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<char*>(char*, char*, std::forward_iterator_tag))[0x564074cd191c]
??:0(void std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<char*>(char*, char*, std::forward_iterator_tag))[0x564074cd2243]
??:0(wsrep_notify_status(wsrep::server_state::state, wsrep::view const*))[0x564074c31d2d]
??:0(mysql_alter_table(THD*, st_mysql_const_lex_string const*, st_mysql_const_lex_string const*, HA_CREATE_INFO*, TABLE_LIST*, Alter_info*, unsigned int, st_order*, bool, bool))[0x5640747ce4fc]
??:0(mysql_recreate_table(THD*, TABLE_LIST*, bool))[0x5640747cfea0]
??:0(MDL_ticket::~MDL_ticket())[0x56407483a38d]
??:0(fill_check_table_metadata_fields(THD*, List<Item>*))[0x56407483c851]
??:0(Sql_cmd_optimize_table::execute(THD*))[0x56407483d7ed]
??:0(mysql_execute_command(THD*, bool))[0x564074732519]
??:0(mysql_parse(THD*, char*, unsigned int, Parser_state*))[0x564074724703]
??:0(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool))[0x56407472e7a6]
??:0(do_command(THD*, bool))[0x56407472fed0]
??:0(tp_callback(TP_connection*))[0x5640748d48d3]
??:0(get_event(worker_thread_t*, thread_group_t*, timespec*))[0x564074ac30b0]
??:0(MyCTX_nopad::finish(unsigned char*, unsigned int*))[0x564074b6713d]
??:0(start_thread)[0x7f7c8e5921ca]
:0(__GI___clone)[0x7f7c8d8e2e73]
 
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (0x7ef7fc013130): optimize table xe_comments_list
 
Connection ID (thread ID): 1790600
Status: NOT_KILLED
 
Optimizer switch: index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off
 
The manual page at https://mariadb.com/kb/en/how-to-produce-a-full-stack-trace-for-mysqld/ contains
information that should help you find out what is causing the crash.
Writing a core file...
Working directory at /db/mysql
Resource Limits:
Limit                     Soft Limit           Hard Limit           Units     
Max cpu time              unlimited            unlimited            seconds   
Max file size             unlimited            unlimited            bytes     
Max data size             unlimited            unlimited            bytes     
Max stack size            8388608              unlimited            bytes     
Max core file size        0                    unlimited            bytes     
Max resident set          unlimited            unlimited            bytes     
Max processes             4127465              4127465              processes 
Max open files            300000               300000               files     
Max locked memory         65536                65536                bytes     
Max address space         unlimited            unlimited            bytes     
Max file locks            unlimited            unlimited            locks     
Max pending signals       4127465              4127465              signals   
Max msgqueue size         819200               819200               bytes     
Max nice priority         0                    0                    
Max realtime priority     0                    0                    
Max realtime timeout      unlimited            unlimited            us        
Core pattern: |/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %h %e
 
Kernel version: Linux version 4.18.0-425.3.1.el8.x86_64 (mockbuild@x86-vm-08.build.eng.bos.redhat.com) (gcc version 8.5.0 20210514 (Red Hat 8.5.0-15) (GCC)) #1 SMP Fri Sep 30 11:45:06 EDT 2022
 
2022-11-29 16:48:33 0 [Note] mariadbd: Aria engine: starting recovery
recovered pages: 0% 14% 48% 64% 100% (0.0 seconds); tables to flush: 1 0
 (0.0 seconds); 
2022-11-29 16:48:33 0 [Note] mariadbd: Aria engine: recovery done
2022-11-29 16:48:33 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2022-11-29 16:48:33 0 [Note] InnoDB: Number of pools: 1
2022-11-29 16:48:33 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
2022-11-29 16:48:33 0 [Note] InnoDB: Using Linux native AIO
2022-11-29 16:48:33 0 [Note] InnoDB: Initializing buffer pool, total size = 549755813888, chunk size = 134217728
2022-11-29 16:48:35 0 [Note] InnoDB: Completed initialization of buffer pool
2022-11-29 16:48:36 0 [Note] InnoDB: Starting crash recovery from checkpoint LSN=35451806789271,35458406739008
2022-11-29 16:48:50 0 [Note] InnoDB: Read redo log up to LSN=35453331680768
2022-11-29 16:49:05 0 [Note] InnoDB: Read redo log up to LSN=35454931545600
2022-11-29 16:49:20 0 [Note] InnoDB: Read redo log up to LSN=35456493792768
2022-11-29 16:49:35 0 [Note] InnoDB: Read redo log up to LSN=35458012786176
2022-11-29 16:49:39 0 [Note] InnoDB: Starting final batch to recover 306852 pages from redo log.
2022-11-29 16:49:50 0 [Note] InnoDB: To recover: 232421 pages from log
2022-11-29 16:50:05 0 [Note] InnoDB: To recover: 205875 pages from log
2022-11-29 16:50:20 0 [Note] InnoDB: To recover: 186210 pages from log
2022-11-29 16:50:35 0 [Note] InnoDB: To recover: 169740 pages from log
2022-11-29 16:50:50 0 [Note] InnoDB: To recover: 155305 pages from log
2022-11-29 16:51:05 0 [Note] InnoDB: To recover: 142354 pages from log
2022-11-29 16:51:20 0 [Note] InnoDB: To recover: 130471 pages from log
2022-11-29 16:51:35 0 [Note] InnoDB: To recover: 119584 pages from log
2022-11-29 16:51:50 0 [Note] InnoDB: To recover: 109353 pages from log
2022-11-29 16:52:05 0 [Note] InnoDB: To recover: 99638 pages from log
2022-11-29 16:52:20 0 [Note] InnoDB: To recover: 90445 pages from log
2022-11-29 16:52:35 0 [Note] InnoDB: To recover: 81628 pages from log
2022-11-29 16:52:50 0 [Note] InnoDB: To recover: 73197 pages from log
2022-11-29 16:53:05 0 [Note] InnoDB: To recover: 65106 pages from log
2022-11-29 16:53:20 0 [Note] InnoDB: To recover: 57337 pages from log
2022-11-29 16:53:35 0 [Note] InnoDB: To recover: 49803 pages from log
2022-11-29 16:53:50 0 [Note] InnoDB: To recover: 42528 pages from log
2022-11-29 16:54:05 0 [Note] InnoDB: To recover: 35449 pages from log
2022-11-29 16:54:20 0 [Note] InnoDB: To recover: 28553 pages from log
2022-11-29 16:54:35 0 [Note] InnoDB: To recover: 21831 pages from log
2022-11-29 16:54:50 0 [Note] InnoDB: To recover: 15281 pages from log
2022-11-29 16:55:05 0 [Note] InnoDB: To recover: 8870 pages from log
2022-11-29 16:55:20 0 [Note] InnoDB: To recover: 2608 pages from log
2022-11-29 16:55:24 0 [Note] InnoDB: Last binlog file '/db/mysql/mysql-bin.001023', position 155517573
2022-11-29 16:55:24 0 [Note] InnoDB: 128 rollback segments are active.
2022-11-29 16:55:24 0 [Note] InnoDB: Removed temporary tablespace data file: "./ibtmp1"
2022-11-29 16:55:24 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2022-11-29 16:55:24 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2022-11-29 16:55:24 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2022-11-29 16:55:24 0 [Note] InnoDB: 10.6.11 started; log sequence number 35458407103175; transaction id 79095061155
2022-11-29 16:55:24 0 [Note] InnoDB: Loading buffer pool(s) from /db/mysql/ib_buffer_pool
2022-11-29 16:55:24 0 [Note] Plugin 'FEEDBACK' is disabled.
2022-11-29 16:55:24 0 [Note] Recovering after a crash using /db/mysql/mysql-bin
2022-11-29 16:55:24 0 [Note] Starting table crash recovery...
2022-11-29 16:55:24 0 [Note] Crash table recovery finished.
2022-11-29 16:55:25 0 [Note] DDL_LOG: Crash recovery executed 1 entries
2022-11-29 16:55:25 0 [Note] Server socket created on IP: '0.0.0.0'.
2022-11-29 16:55:25 0 [Note] Server socket created on IP: '::'.
2022-11-29 16:55:25 5 [Note] Slave I/O thread: Start asynchronous replication to master 'slave_user@[REDACTED]:3306' in log 'mysql-bin.000176' at position 331827117
2022-11-29 16:55:25 5 [Note] Slave I/O thread: connected to master 'slave_user@[REDACTED]:3306',replication started in log 'mysql-bin.000176' at position 331827117
2022-11-29 16:55:25 0 [Note] /usr/sbin/mariadbd: ready for connections.
Version: '10.6.11-MariaDB-log'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  MariaDB Server
2022-11-29 16:55:25 6 [Note] Slave SQL thread initialized, starting replication in log 'mysql-bin.000176' at position 331827117, relay log '/db/mysql/relay-bin.000266' position: 238805436
2022-11-29 16:56:22 0 [Note] InnoDB: Buffer pool(s) load completed at 221129 16:56:22

Of note we used one of the AMD servers to binary copy(after shutting down mariadb completely) and rsync mirror all the database data to the Intel and other AMD servers a week ago, and had no replication errors. So the Intel server is actually is a copy of the AMD server data and had no error, so it perhaps some bug is related with AMD servers and MariaDB.



 Comments   
Comment by F K [ 2022-11-29 ]

Additional note:
Differences in config between one intel and one AMD server slave:
Intel / AMD
innodb_buffer_pool_size 343597383680 / 549755813888
large_pages OFF / ON

Along with AMD servers being run as "ExecStart=numactl --cpunodebind=1 --interleave=all ...." due to suspected severe performance problems when 2 CPUs are used.

Hyperthreading was turned off all the time on AMD servers(as they have a total 128 cores we didn't think it would help much).

Comment by Marko Mäkelä [ 2022-11-29 ]

Can you please try to identify the crashing instruction, similar to how it was done in MDEV-24745?

As a starting point, you should install the debug symbols for the server. I think that in rpm-based packages, the package name has -debuginfo in it. Then, try to produce a full stack trace using a debugger. In GDB, I would additionally suggest

info registers

in the crashing thread (usually but not always it is thread 1).

Also, which location did you download the package from? I think that it will be necessary to examine the exact same binary code to figure out what is going on.

Comment by F K [ 2022-11-29 ]

> Can you please try to identify the crashing instruction, similar to how it was done
I am not familar with the technical details in the ticket you linked to, it seems out of my depth.
Does that require retrying the bug? Of note our DB is 1.5 TB.
I have backed up the data just in case something is needed for reply, and are copying the binary data from an intel slave back to AMD slave just in case it is broken to be on the safe side.
I'll keep the old mariadb data for a few days if there is something you need.

> Also, which location did you download the package from? I think that it will be necessary to examine the exact same binary code to figure out what is going on.
This is easy, we used the following offical MariaDB repo:
/etc/yum.repos.d/MariaDB.repo
[mariadb]
name = MariaDB
baseurl = http://archive.mariadb.org/mariadb-10.6.11/yum/rhel8-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

One question is do you have any opinion or comments regarding the performance problems we suspect on AMD EPYC dual 7773X servers? Do you think we would have better performance on single EPYC cpu servers or recommend just using Intel servers?

Tha nkyou.

Comment by Marko Mäkelä [ 2022-11-29 ]

FK, the problem is that the built-in stack trace reporter is garbage, at least in anything above mysql_alter_table(). Something apparently crashes during a table rebuild that is being executed during OPTIMIZE TABLE.

InnoDB used to crash on corrupted data until MDEV-13542 was fixed, typically with an assertion failure. Now something crashes with SIGSEGV, dereferencing an invalid address (typically a null pointer). Without knowing where it crashes, the bug can’t be fixed.

I downloaded the following two packages and will figure out how to extract the files on my Debian system:

MariaDB-server-10.6.11-1.el8.x86_64.rpm
MariaDB-server-debuginfo-10.6.11-1.el8.x86_64.rpm

But, I will need the correct address of the crashing instruction as a starting point. I am afraid that the hexadecimal addresses in the log output are subject to ASLR.

Comment by F K [ 2022-11-29 ]

I deleted one comment, that I found unrelated to this problem and due to oom-killer.

This bug in this ticket had no such error.

Maybe this will help, the following log was noted in /var/log/messages(of note the segfault line and next kernel Code line is same in both servers):

Nov 29 16:48:27 f95 kernel: mariadbd[4095472]: segfault at 7efa413d6000 ip 0000564074ccff0c sp 00007efb10076ab0 error 4 in mariadbd[56407
3f96000+1581000]
Nov 29 16:48:27 f95 kernel: Code: ff 03 00 00 48 89 50 10 48 8b 55 98 50 41 52 e8 ba f4 ff ff 48 8b 4d b8 89 01 58 5a e9 a3 01 00 00 0f 1
f 44 00 00 48 8b 45 10 <0f> b6 40 01 48 83 f8 7f 0f 87 06 05 00 00 48 8b 4d 10 48 83 c1 02
Nov 29 16:48:27 f95 systemd[1]: Started Process Core Dump (PID 741170/UID 0).
Nov 29 16:48:27 f95 systemd-coredump[741171]: Resource limits disable core dumping for process 2378126 (mariadbd).
Nov 29 16:48:27 f95 systemd-coredump[741171]: Process 2378126 (mariadbd) of user 767 dumped core.
Nov 29 16:48:27 f95 systemd[1]: systemd-coredump@0-741170-0.service: Succeeded.
Nov 29 16:48:28 f95 systemd[1]: mariadb.service: Main process exited, code=dumped, status=11/SEGV
Nov 29 16:48:28 f95 systemd[1]: mariadb.service: Failed with result 'core-dump'.
Nov 29 16:48:33 f95 systemd[1]: mariadb.service: Service RestartSec=5s expired, scheduling restart.
Nov 29 16:48:33 f95 systemd[1]: mariadb.service: Scheduled restart job, restart counter is at 1.
Nov 29 16:48:33 f95 systemd[1]: Stopped MariaDB 10.6.11 database server.
Nov 29 16:48:33 f95 systemd[1]: Starting MariaDB 10.6.11 database server...
Nov 29 16:48:33 f95 numactl[744695]: 2022-11-29 16:48:33 0 [Note] /usr/sbin/mariadbd (server 10.6.11-MariaDB-log) starting as process 744
695 ...
Nov 29 16:48:33 f95 numactl[744695]: 2022-11-29 16:48:33 0 [Warning] Could not increase number of max_open_files to more than 300000 (req
uest: 337711)

Comment by Daniel Black [ 2022-11-30 ]

I think I can get somewhere with that: ip - base_address (0x564073f96000) = 0xD39F0C

$ rpm2cpio MariaDB-server-10.6.11-1.el8.x86_64.rpm | cpio -idmv
$ rpm2cpio MariaDB-server-debuginfo-10.6.11-1.el8.x86_64.rpm  | cpio -idmv
gdb ./usr/sbin/mariadbd
 
(gdb)  directory ./usr/src/debug/MariaDB-/src_0/
Source directories searched: /home/dan/Downloads/./usr/src/debug/MariaDB-/src_0:/home/dan/Downloads:$cdir:$cwd
(gdb) set debug-file-directory /home/dan/Downloads//usr/lib/debug
(gdb)   show debug-file-directory
The directory where separate debug symbols are searched for is "/home/dan/Downloads//usr/lib/debug".
(gdb) file ./usr/sbin/mariadbd
Reading symbols from ./usr/sbin/mariadbd...
Reading symbols from /home/dan/Downloads/usr/lib/debug/usr/sbin/mariadbd-10.6.11-1.el8.x86_64.debug...
(gdb) list *0xD39F0C
0xd39f0c is in row_log_table_apply_op(que_thr_t*, ulint, row_merge_dup_t*, dberr_t*, mem_heap_t*, mem_heap_t*, mrec_t const*, mrec_t const*, rec_offs*) (/usr/src/debug/MariaDB-/src_0/storage/innobase/row/row0log.cc:2173).
2168		default:
2169			ut_ad(0);
2170			*error = DB_CORRUPTION;
2171			return(NULL);
2172		case ROW_T_INSERT:
2173			extra_size = *mrec++;
2174	
2175			if (extra_size >= 0x80) {
2176				/* Read another byte of extra_size. */
2177	
 
 
   0x0000000000d39efe <+654>:	jmp    0xd3a0a6 <_ZL22row_log_table_apply_opP9que_thr_tmP15row_merge_dup_tP7dberr_tP16mem_block_info_tS6_PKhS8_Pt+1078>
   0x0000000000d39f03 <+659>:	nopl   0x0(%rax,%rax,1)
   0x0000000000d39f08 <+664>:	mov    0x10(%rbp),%rax
   0x0000000000d39f0c <+668>:	movzbl 0x1(%rax),%eax
   0x0000000000d39f10 <+672>:	cmp    $0x7f,%rax
   0x0000000000d39f14 <+676>:	ja     0xd3a420 <_ZL22row_log_table_apply_opP9que_thr_tmP15row_merge_dup_tP7dberr_tP16mem_block_info_tS6_PKhS8_Pt+1968>
   0x0000000000d39f1a <+682>:	mov    0x10(%rbp),%rcx
   0x0000000000d39f1e <+686>:	add    $0x2,%rcx
   0x0000000000d39f22 <+690>:	add    %rcx,%rax

On the crash it appears systemd-coredump has captured the coredump.

After installing debuginfo packages (dnf install install MariaDB-server-debuginfo), (note: they don't need to be installed at the time of the crash, only at debugging)

Assuming gdb is installed too we'll look at the backtrace and the code generated. Then we can look for AMD incompatible code and out build chain.

coredumpctl for debugging

coredumpctl debug
 
(gdb) bt full
...
(gdb)   disassemble
....
(gdb) registers
...
/* then "up" until in row_log_table_apply_op */
(gdb) info locals
...

On performance measurements, suggest using perf record -g -p $(pidof mariadb) / perf report, comparing, maybe with some flame graphs between the two.

Note systemd v243 onwards has better numa options - https://www.freedesktop.org/software/systemd/man/systemd.exec.html#NUMAPolicy=

Comment by F K [ 2022-11-30 ]

Just a note: no core dump file.

[root@[REDACTED] ~]# coredumpctl
TIME PID UID GID SIG COREFILE EXE
Tue 2022-11-29 16:38:44 KST 1215950 767 767 11 none /usr/sbin/mariadbd
[root@[REDACTED] ~]# coredumpctl debug
PID: 1215950 (mariadbd)
UID: 767 (mysql)
GID: 767 (mysql)
Signal: 11 (SEGV)
Timestamp: Tue 2022-11-29 16:38:44 KST (24h ago)
Command Line: /usr/sbin/mariadbd
Executable: /usr/sbin/mariadbd
Control Group: /system.slice/mariadb.service
Unit: mariadb.service
Slice: system.slice
Boot ID: af2078efd2534a9ea45dc4e4333a55f7
Machine ID: cb5211815ad64289b825c6b1a6069cda
Hostname: [REDACTED]
Storage: none
Message: Process 1215950 (mariadbd) of user 767 dumped core.

Coredump entry has no core attached (neither internally in the journal nor externally on disk).

Comment by F K [ 2022-11-30 ]

Additional note:
The following test had no problem.

Same DB and table was binary copied from non-crashed intel server(more binlogs applied and after the optimize was done successfully on the intel server).
MariaDB was downgraded to 10.6.10
Table had more binlog applied since last crash, table had same indexes but did not have one index added and dropped(which was one the reasons we ran the optimize table).
Server had large pages disabled and booted.
During current server test, it had no other queries sent to it, while during the initial crash other select queries were going to it.
Both were slaves and replicating with no slave lag.

We track all config changes through monitoring tool.
These are the changes that were made when the server crashed and when the server didn't with the same optimize command:
innodb_io_capacity 10000 -> 20000
innodb_io_capacity_max 20000 -> 40000 (this we did not touch, but mariadb modified automatically)
innodb_read_io_threads 4 -> 16
innodb_version 10.6.11 -> 10.6.10 (downgraded)
innodb_write_io_threads 4 -> 16
large_pages ON -> OFF
version 10.6.11-MariaDB-log -> 10.6.10-MariaDB-log
version_source_revision efa28fb234b6603ea1e1aa3951925c98146686eb -> fd0bdd3180a7d5f4b9804d372d6a63b6a202818c

Comment by F K [ 2022-11-30 ]

One additional note regarding "First of all we noticed the AMD servers have much poor performance compared to Intel servers(when used as master, the slave are really unneccessary and have little load), nearly being unresponsive with high load, while intel servers having much lower specs were much more stable(when used as master)."

When changing from Intel to AMD servers we did three major changes other than hardware and bigger innodb buffer.
Two of them would be changing large_pages to ON and numa setting tests.
But another third change I missed initially was that we upgraded 10.6.10 to 10.6.11.
We have tens of thousands of queries per second on the master(slave is mostly just for testing/backup and migration to new servers and low load), suggesting that https://jira.mariadb.org/browse/MDEV-29988 might be related to our performance problems.

However, the "[ERROR] mysqld got signal 11" error was not found on any of the 3 Intel servers running 10.6.11 and only on all 2 AMD servers running 10.6.11. I do not know if that is coincidence or not.

Comment by Marko Mäkelä [ 2022-11-30 ]

FK, thanks to danblack’s help, we now know that the crash occurs during an online table rebuild, while applying log that was written by concurrently running DML operations. Somehow the log file is corrupted. I do not think that we have seen this in our internal testing.

Have you tried to run sudo memtester on the affected system?

This could still be a software bug, requiring some (mis)fortune to reproduce it. Were you able to identify the OPTIMIZE TABLE statement that was running during the crash? Could we get the SHOW CREATE TABLE output for that table? You can obfuscate the names of the table, the indexes, and the columns, but not the data types and the indexes.

MDEV-28880 might be a duplicate of MDEV-24412.

Comment by F K [ 2022-11-30 ]

> Have you tried to run sudo memtester on the affected system?
These servers had memtester burn in tests for at least a few days before being installed.
Also the error occured on two AMD servers at the same time.

This is the schema with redacted names:

CREATE TABLE `[TABLENAME]` (
[REDACTEDc] bigint(11) NOT NULL,
[REDACTEDd] bigint(11) NOT NULL,
[REDACTEDh] bigint(11) NOT NULL,
[REDACTEDa] bigint(11) NOT NULL,
[REDACTEDm] bigint(11) NOT NULL,
[REDACTEDr] bigint(14) NOT NULL DEFAULT 0,
[REDACTEDd] bigint(11) NOT NULL,
PRIMARY KEY ([REDACTEDc]),
KEY `[REDACEDK1]` ([REDACTEDd],[REDACTEDh],[REDACTEDa]),
KEY `[REDACEDD1]` ([REDACTEDm],[REDACTEDr]),
KEY [REDACTEDh] ([REDACTEDh])
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci

This is the command used:
OPTIMIZE TABLE [TABLENAME]

Comment by F K [ 2022-11-30 ]

Another note, I made a typo above
"suggesting that https://jira.mariadb.org/browse/MDEV-28880 might be related to our performance problems."

should be https://jira.mariadb.org/browse/MDEV-29988
(I changed the text in the comment)

Comment by Marko Mäkelä [ 2022-11-30 ]

FK, the table structure looks rather basic. Only NOT NULL integer columns, no virtual columns. I hope that you can enable core dumps so that when it occurs again, we will have something more to debug on. Note: ever since MDEV-10814 was implemented in MariaDB Server 10.3, core dumps do not include large InnoDB data structures, such as the buffer pool.

Comment by F K [ 2022-11-30 ]

Do you have a recommended method for doing so for Mariadb (as I am not familiar with core dumps).
If I have time in the future, I might try to recreate the issue as I saved the database state after the core dump before rsyncing data from other slave servers to be safe.

Comment by Marko Mäkelä [ 2022-12-01 ]

danblack should be able to guide you through reproducing the problem. As you can find in https://mariadb.org/contribute/, a better option than this ticket system could be Zulip chat. His approximate time zone is UTC+1100.

I would really appreciate the effort, so that we can solve the mystery.

Comment by F K [ 2023-02-20 ]

I just tested with the backup data I saved during crash.
However, some conditions must have changed, preventing me from reproducing the issue.
Of note, two major changes compared to crash for my attempt to recreate the issue:

  • The data used is backup after crash (could not get data before crash).
  • The MariaDB version used was 10.6.10 for current test, while the crash was on 10.6.9

This ticket can be closed, as I failed to reproduce the issue.
Thank you.
Have a nice day.

Comment by Daniel Black [ 2023-02-20 ]

You too FK. Thanks for reporting back.

Generated at Thu Feb 08 10:13:50 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.