Where io_setup fails, this is a serious issue, normally because
of the lack of fs.aio-max-nr configured in the kernel.
We adjust the error message to be a Warning, because like
"native AIO failed: falling back to innodb_use_native_aio=OFF",
its user actionable.
A default configuation of the server and indeed raising
innodb_write_io_threads and innodb_read_io_threads couldn't
exceed the default fs.aio-max-nr value. If a user is
constructing multipe instances of MariaDB that exceed this
value then they should be seeing the warning and taking action.
There are CI environments, as Otto points on on Launchpad,
that have insufficient fs.aio-max-nr configure to run mtr
in parallel. This however a genuine distro problem and
to resolve.
For us, and our developers, we'd rather see the warning
so we can fix CI and dev instances that are insufficiently
configured.
The io_setup man page as a very short but descript set of
causes for the io_setup failures. Its safer to refer to this,
now with a strerror description rather than a number.
The mtr suppressions are removed because a while ago
when the errors where moved out of InnoDB and recently
the server could never generate a warning of these forms.
This controls which linux implementation to use for
innodb_use_native_aio=ON.
innodb_linux_aio=auto is equivalent to innodb_linux_aio=io_uring when
it is available, and falling back to innodb_linux_aio=aio when not.
Debian packaging is no longer aio exclusive or uring, so
for those older Debian or Ubuntu releases, its a remove_uring directive.
For more recent releases, add mandatory liburing for consistent packaging.
WITH_LIBAIO is now an independent option from WITH_URING.
LINUX_NATIVE_AIO preprocessor constant is renamed to HAVE_LIBAIO,
analogous to existing HAVE_URING.
tpool::is_aio_supported(): A common feature check.
is_linux_native_aio_supported(): Remove. This had originally been added in
mysql/mysql-server@0da310b69d in 2012
to fix an issue where io_submit() on CentOS 5.5 would return EINVAL
for a /tmp/#sql*.ibd file associated with CREATE TEMPORARY TABLE.
But, starting with commit 2e814d4702 InnoDB
temporary tables will be written to innodb_temp_data_file_path.
The 2012 commit said that the error could occur on "old kernels".
Any GNU/Linux distribution that we currently support should be based
on a newer Linux kernel; for example, Red Hat Enterprise Linux 7
was released in 2014.
tpool::create_linux_aio(): Wraps the Linux implementations:
create_libaio() and create_liburing(), each defined in separate
compilation units (aio_linux.cc, aio_libaio.cc, aio_liburing.cc).
The CMake definitions are simplified using target_sources() and
target_compile_definitions(), all available since CMake 2.8.12.
With this change, there is no need to include ${CMAKE_SOURCE_DIR}/tpool
or add TPOOL_DEFINES flags anymore, target_link_libraries(lib tpool)
does all that.
This is joint work with Daniel Black and Vladislav Vaintroub.