scripts/fill_help_tables.sql from
https://github.com/mariadb-corporation/mariadb-docs/ as of
3fb208fcdfed06beb52ef9e305017de2387ff012
Other URL changes are taken from the HTTP redirection URL
from the old KB.
Some test cases where impacted:
* ps_missed_cmds{,_bin_prot} - used a topic_id of 0 that is
now used, used MAX_INT instead.
* range_notembedded used the help data as a test case. As its not
a stable table data, replaces with static data. Test case valid
by ensuring the ANALYZE EXPLAIN and optimizer trace had the same
structure. Also valided the MDEV-24739/MDEV-25069 bug fixes from
where the test case originaled, when reverted, exhibited the
previous behavour before the bug fixes.
The mysys timer (thr_timer) could deadlock with
srv_thread_pool_end() due to lock inversion:
- LOCK_timer is held during the entire timer action routine.
- timer action executed in mysys thread may lock timer_generic::m_mtx.
- main thread holding the same timer_generic::m_mtx calls
thr_timer_end(), which also needs LOCK_timer.
This inversion can cause a very rare shutdown deadlock, when the
threadpool extends the maintenance() period after idling for a
minute and shutdown occurs simultaneously.
Workaround: Use try_lock in timer_generic::set_period() to avoid blocking,
to break the deadlock cycle, and ignore errors.
Root cause is the thr_timer holds the global LOCK_timer for the
entire duration of every timer action. This makes it difficult or
impossible to use additional locks safely inside timer routines.
Fortunately, in this case a failed try_lock has no impact.
On Linux, introduce object library tpool_common, which contains non-AIO
code.It is linked to both full tpool library (with AIO),
and tpool_min(without AIO).
As a result, building tpool_min now requires only compiling a single
small source file.
aio::synchronous(), aio::flush_synchronous() are moved into aio specific
source file, from common threadpool_generic.cc, in order to avoid ABI
breakage (size of aiocb depends on HAVE_LIBAIO etc compile options on Linux)
On Linux, mariadb-import may depend on liburing and libaio. To avoid
pulling in these dependencies when tpool is only used as a generic
thread pool (submit_task), introduce a minimalistic variant of the tpool
library, tpool_min.
This variant has no new library dependencies, and exists only on Linux.
Elsewhere, tpool_min is the same as tpool
The uring_ member of the aio_uring class needed to be
defined to make MSAN happy.
To make aio_uring consistent with aio_libaio in the 10.11 branch,
added the "using namespace tpool" and removed tpool scoped quantifiers.
10.6 aio_uring is defined in the tpool namespace however changing
that would just cause merge conflicts.
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.
A read from liburing has its output buffer as defined
by the nature of the system call.
Instrumenting the library proved difficult as the
completion events don't include the opcode or pointers
that where there on submission. It was just easier
to do this in the application code.
main/statistics_json.result is updated for f8ba5ced55 (MDEV-36099)
The test uses 'delete from t1' in many places and then populates
the table again. The natural order of rows in a MyISAM table is well
defined and the test was implicitly relying on that.
before f8ba5ced55 delete was deleting rows one by one, using
ha_myisam::delete_row() because the connection was stuck in rbr mode.
This caused rows to be shown in the reverse insertion order (because of
the delete link list).
MDEV-36099 fixes this bug and the server now correctly uses
ha_myisam::delete_all_rows(). This makes rows to be shown in the
insertion order as expected.
As noted in commit c36834c832
the MemorySanitizer instrumented builds so far only work with
the synchronous I/O interface (innodb_use_native_aio=OFF).
It is not that hard to make WITH_MSAN=ON work with the
Linux libaio, without even instrumenting that library itself.
aio_linux::getevent_thread_routine(): Declare the buffer that
is returned by my_getevents() as initialized. Declare
the data returned by a successful aio_opcode::AIO_PREAD as initialized.
Reviewed by: Daniel Black
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.
As noted by Jens Axobe, errno isn't set, it is returned
by the io_uring_queue_init function.
As such users where getting the following as the common case
when EPERM was actually intended to be returned.
"mariadbd: io_uring_queue_init() failed with errno 0".
Add to error message the correct relevant information around EPERM.
log_file_t::read(), log_file_t::write(): Invoke pread() or pwrite()
directly, so that we can give more accurate diagnostics in case of
a failure, and so that we will avoid the overhead of setting up 5(!)
stack frames and related objects.
tpool::pwrite(): Add a missing const qualifier.