Bug #94504 AIO::s_log seems useless
Submitted: 28 Feb 5:59 Modified: 28 Feb 14:19
Reporter: yuhui wang Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S3 (Non-critical)
Version:8.0.15 OS:Any
Assigned to: CPU Architecture:x86
Tags: aio, AIO::s_log, checkpoint, do_io, fil_checkpoint_io

[28 Feb 5:59] yuhui wang
Description:
In MySQL IO subsystem, we have five types io threads: os_aio_read_array/os_aio_write_array/os_aio_ibuf_array/os_aio_sync_array/os_aio_log_array. Before MySQL 8, os_aio_log_array(AIO::s_log in MySQL 8) is used for checkpoint logging as we write checkpoint asynchronously. However, in MySQL 8,we have changed checkpoint logging to synchronous writing just as normal redolog writing. In detail, we use function 'fil_redo_io' to write checkpoint. In other words, there is no need to reserve os_aio_log_array any more. 

How to repeat:
AIO_mode Fil_shard::get_AIO_mode(const IORequest &req_type, bool sync) {
#ifndef UNIV_HOTBACKUP
  if (sync) {
    return (AIO_mode::SYNC);

  } else if (req_type.is_log()) {
    ut_error;                                   
    return (AIO_mode::LOG);

  } else {
    return (AIO_mode::NORMAL);
  }
#else  /* !UNIV_HOTBACKUP */
  ut_a(sync);
  return (AIO_mode::SYNC);
#endif /* !UNIV_HOTBACKUP */
}

In 8.0.15, I have added 'ut_error' in get_AIO_mode and runed for a long time. It seems the server will not crash.

Suggested fix:
Remove codes related to log array.
[28 Feb 14:19] Sinisa Milivojevic
Hi Yuhui,

Thank you very much for your bug report.

I have analysed thoroughly the subject that you are writing about and I agree with you 100 %.

Verified as reported.