Description:
We meet a server crash when excuting select count query by setting innodb_parallel_read_threads=16 and innodb_parallel_select_count=ON.
Here is the error log info:
InnoDB: Next record offset is nonsensical 65280 in record at offset 101
InnoDB: rec address 0x7f766a448065, space id 38, page 1769553
2025-03-05T13:06:00.078528+08:00 0 139843338299136 [ERROR] [MY-013183] [InnoDB] Assertion failure: page0page.ic:681 thread 139843338299136
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/8.0/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
error, set config faild while getting storage gid.
05:06:00 UTC - mysqld got signal 6 ;
Most likely, you have hit a bug, but this error can also be caused by malfunctioning hardware.
Thread pointer: 0x7f31138d5000
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 = 7f2fd080b588 thread_stack 0x46000
/usr/local/engine/bin/mysqld(my_print_stacktrace(unsigned char const*, unsigned long)+0x2e) [0x1ba298e]
/usr/local/engine/bin/mysqld(handle_fatal_signal+0x208) [0x10f0f38]
/lib64/libpthread.so.0(+0xf700) [0x7f8ba9737700]
/lib64/libc.so.6(gsignal+0x37) [0x7f8ba6e204e7]
/lib64/libc.so.6(abort+0x148) [0x7f8ba6e21bd8]
/usr/local/engine/bin/mysqld(ut_dbg_assertion_failed(char const*, char const*, unsigned long)+0x136) [0x1dc5426]
/usr/local/engine/bin/mysqld() [0x5fa28bb]
/usr/local/engine/bin/mysqld(Parallel_reader::Ctx::traverse_recs(PCursor*, mtr_t*)+0x184) [0x5a12e10]
/usr/local/engine/bin/mysqld(Parallel_reader::Ctx::traverse()+0xbf) [0x5b3d0bf]
/usr/local/engine/bin/mysqld(Parallel_reader::worker(Parallel_reader::Thread_ctx*)+0x1d6) [0x5b3ced6]
/usr/local/engine/bin/mysqld() [0x5cf9526]
/usr/local/engine/bin/mysqld() [0x5c80510]
/lib64/libpthread.so.0(+0x7e15) [0x7f8ba972fe15]
/lib64/libc.so.6(clone+0x6d) [0x7f8ba6eebfed]
According to the assertion failure, the Parallel_reader gets an invalid rec offset by PCursor.
The crash is occasional but no longer happen after setting innodb_parallel_select_count=OFF.
It proves that the data file is correct, so we wondering is there some logic or memory issue with parallel select count query?
How to repeat:
There is no stable way to repeat.
Executing select count query while innodb_parallel_read_threads=16 and innodb_parallel_select_count=ON, then the crash happens randomly.