MDEV-24313 (2 of 2): Silently ignored innodb_use_native_aio=1

In commit 5e62b6a5e0 (MDEV-16264)
the logic of os_aio_init() was changed so that it will never fail,
but instead automatically disable innodb_use_native_aio (which is
enabled by default) if the io_setup() system call would fail due
to resource limits being exceeded. This is questionable, especially
because falling back to simulated AIO may lead to significantly
reduced performance.

srv_n_file_io_threads, srv_n_read_io_threads, srv_n_write_io_threads:
Change the data type from ulong to uint.

os_aio_init(): Remove the parameters, and actually return an error code.

thread_pool::configure_aio(): Do not silently fall back to simulated AIO.

Reviewed by: Vladislav Vaintroub
This commit is contained in:
Marko Mäkelä 2020-12-14 15:27:03 +02:00
commit f24b738318
10 changed files with 58 additions and 83 deletions

View file

@ -2128,9 +2128,9 @@ static bool innodb_init_param()
srv_buf_pool_size = (ulint) xtrabackup_use_memory;
srv_buf_pool_chunk_unit = (ulong)srv_buf_pool_size;
srv_n_file_io_threads = (ulint) innobase_file_io_threads;
srv_n_read_io_threads = innobase_read_io_threads;
srv_n_write_io_threads = innobase_write_io_threads;
srv_n_file_io_threads = (uint) innobase_file_io_threads;
srv_n_read_io_threads = (uint) innobase_read_io_threads;
srv_n_write_io_threads = (uint) innobase_write_io_threads;
srv_max_n_open_files = ULINT_UNDEFINED - 5;
@ -4273,8 +4273,10 @@ fail:
xb_fil_io_init();
srv_n_file_io_threads = srv_n_read_io_threads;
os_aio_init(srv_n_read_io_threads, srv_n_write_io_threads,
SRV_MAX_N_PENDING_SYNC_IOS);
if (os_aio_init()) {
msg("Error: cannot initialize AIO subsystem");
goto fail;
}
log_sys.create();
log_sys.log.create();