Bug #112699 log thread is useless
Submitted: 12 Oct 2023 9:11 Modified: 12 Oct 2023 9:55
Reporter: Ke Yu (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S3 (Non-critical)
Version:8.0.31 OS:Any
Assigned to: CPU Architecture:Any

[12 Oct 2023 9:11] Ke Yu
Description:
The log thread is useless, but still running.

How to repeat:
1. show engine innodb status\G, some of the results are as follows, the log thread is running:

--------
FILE I/O
--------
I/O thread 0 state: waiting for completed aio requests (insert buffer thread)
I/O thread 1 state: waiting for completed aio requests (log thread)
I/O thread 2 state: waiting for completed aio requests (read thread)
I/O thread 3 state: waiting for completed aio requests (read thread)
I/O thread 4 state: waiting for completed aio requests (read thread)
I/O thread 5 state: waiting for completed aio requests (read thread)
I/O thread 6 state: waiting for completed aio requests (write thread)
I/O thread 7 state: waiting for completed aio requests (write thread)
I/O thread 8 state: waiting for completed aio requests (write thread)
I/O thread 9 state: waiting for completed aio requests (write thread)

2. From the source code, we find that in select_slot_array function, only s_reads\s_writes\s_ibuf are used for AIO.
No AIO requests will be submitted to the log thread. The log thread is used to write checkpoint information before, but the log_checkpointer thread is now responsible for this

Suggested fix:
Remove the log thread.
[12 Oct 2023 9:55] Ke Yu
I found 8.0.34 removed this log thread.