1
0
mirror of https://github.com/MariaDB/server.git synced 2026-10-23 18:49:29 +03:00
Commit Graph

152 Commits

Author SHA1 Message Date
Kristian Nielsen
fcc5fc8916 Merge 11.8 to 12.3
Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
2026-06-15 16:53:03 +02:00
Kristian Nielsen
420e28ce28 Merge 11.4 to 11.8
Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
2026-06-15 15:15:10 +02:00
Andreas Schwab
b27ccf7b01 MDEV-39925: Fix error reporting in create_libaio
The io_setup function in libaio returns a negated errno value on error,
but strerror expects a normal errno value.
2026-06-09 14:08:34 +03:00
Daniel Black
8923afa5c2 MDEV-39584: update help sql tables and replace KB links
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.
2026-05-15 13:30:21 +10:00
Oleksandr Byelkin
c976b527db Merge branch '11.8' into bb-12.1-release 2025-10-08 09:05:38 +02:00
Aleksey Midenkov
ff33f49d9a Merge 11.4 into 11.8 2025-09-29 18:25:09 +03:00
Vladislav Vaintroub
21395bbb6c MDEV-37728: Fix shutdown deadlock between thr_timer_end and set_period
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.
2025-09-24 22:25:59 +02:00
Vladislav Vaintroub
a667c0c0e1 MDEV-37463 - minimize recompilation required for tpool_min
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)
2025-09-08 12:33:13 +02:00
Vladislav Vaintroub
4995584f3c MDEV-37463 Avoid libaio/liburing dependencies in mariadb-import
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
2025-09-08 12:33:13 +02:00
Monty
536703e51e Fixed that valgrind can be used with InnoDB using aio on Linux.
Fixed by calling MEM_MAKE_DEFINED() when InnoDB has read a page.

Author: Vladislav Lesin vladislav.lesin@mariadb.com
2025-09-04 18:08:39 +03:00
Marko Mäkelä
b489d5f813 Merge 10.6 into 10.11 2025-08-26 14:24:31 +03:00
Daniel Black
a1bba0e31c MDEV-36482: Make liburing work WITH_MSAN=ON (fix)
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.
2025-08-25 17:31:40 +10:00
Daniel Black
ba9e8ebdbe MDEV-37411: Clear warnings for io_setup failure
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.
2025-08-22 16:48:02 +10:00
Daniel Black
2c30f92dd3 MDEV-36482: Make liburing work WITH_MSAN=ON
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.
2025-08-22 14:34:40 +10:00
Sergei Golubchik
aab83aecdc Merge branch '11.8' into 12.0
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.
2025-07-31 20:55:47 +02:00
Sergei Golubchik
b565b3e7e0 Merge branch '11.4' into 11.8 2025-07-28 21:29:29 +02:00
Sergei Golubchik
053f9bcb5b Merge branch '10.6' into 10.11 2025-07-28 18:06:31 +02:00
Sergei Golubchik
9306353d2d MDEV-36753 Assertion `str[strlen(str)-1] != '\n'' failed in my_message_sql upon REPAIR .. USE_FRM with encryption enabled
remove '\n' from error log messages
2025-07-17 09:18:17 +02:00
Marko Mäkelä
3c67d73aad MDEV-36482: Make libaio work WITH_MSAN=ON
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
2025-06-26 10:05:36 +03:00
Marko Mäkelä
a87bb96ecb MDEV-36234: Add innodb_linux_aio
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.
2025-06-23 13:51:52 +03:00
Oleksandr Byelkin
f1102da37a Merge branch '11.8' into 12.0 2025-05-22 09:22:55 +02:00
Sergei Golubchik
237e24497b Merge remote-tracking branch 'github/bb-11.4-release' into bb-11.8-serg 2025-04-27 19:40:00 +02:00
Oleksandr Byelkin
20b818f45e Merge branch '10.6' into 10.11 2025-04-21 11:23:11 +02:00
Daniel Black
839e8bfe9f MDEV-36182: liburing - incorrect error handing.
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.
2025-04-17 15:58:11 +10:00
Daniel Black
73cdeda347 tpool: remove m_group_enqueued (unused)
Noted in MDEV-36542 that it wasn't used and
the compile warning -Wunused-private-field is legitimate.

Review: Vladislav Vaintroub
2025-04-17 15:31:39 +10:00
Vasilii Lakhin
5f7c2a617f Fix typos in C comments in miscellaneous files 2025-03-24 13:36:28 +11:00
Marko Mäkelä
15700f54c2 Merge 11.4 into 11.7 2025-01-09 09:41:38 +02:00
Marko Mäkelä
420d9eb27f Merge 10.6 into 10.11 2025-01-08 12:51:26 +02:00
Marko Mäkelä
b251cb6a4f Merge 10.5 into 10.6 2025-01-08 08:48:21 +02:00
Vladislav Vaintroub
a2f510fccf MDEV-33978 P_S.THREADS is not showing all server threads
This patch only makes sure Linux getevents thread is shown in PS
2025-01-07 15:49:20 +01:00
Marko Mäkelä
33907f9ec6 Merge 11.4 into 11.7 2024-12-02 17:51:17 +02:00
Marko Mäkelä
3d23adb766 Merge 10.6 into 10.11 2024-11-29 13:43:17 +02:00
Vladislav Vaintroub
37b7986467 Merge branch '10.5' into 10.6 2024-11-05 21:02:22 +01:00
Vladislav Vaintroub
d64034770e MDEV-35273 tpool::worker_data - replace MY_ALIGNED with pad member 2024-10-28 16:24:53 +01:00
Marko Mäkelä
43465352b9 Merge 11.4 into 11.6 2024-10-03 16:09:56 +03:00
Marko Mäkelä
dd5ce6b0c4 MDEV-34450 os_file_write_func() is an overkill for ib_logfile0
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.
2024-09-30 13:36:38 +03:00
Vladislav Vaintroub
c483c5ca56 MDEV-33627 preparation - tpool fix
Fix tpool to not use maintenance timer for fixed pool size.
2024-07-16 15:00:29 +02:00
Alexander Barkov
a2a5ba14a8 Merge remote-tracking branch 'origin/11.5' into 11.6 2024-07-10 19:18:52 +04:00
Alexander Barkov
4e805aed85 Merge remote-tracking branch 'origin/11.4' into 11.5 2024-07-10 12:17:09 +04:00
Vladislav Vaintroub
584fc85e21 MDEV-32537 Name threads to improve debugging experience and diagnostics.
Use SetThreadDescription/pthread_setname_np to give threads a name.
2024-07-09 13:17:20 +02:00
Alexander Barkov
8f4ec79d09 Merge remote-tracking branch 'origin/11.4' into 11.5 2024-07-08 12:25:04 +04:00
Oleksandr Byelkin
034a175982 Merge branch '10.6' into 10.11 2024-07-04 11:52:07 +02:00
Daniel Black
d472391471 tpool: correct LIBAIO_REQIRED typo
Noticed thanks to Razvan Liviu Varzaru
2024-06-29 15:25:08 +10:00
Marko Mäkelä
27a3366663 Merge 10.6 into 10.11 2024-06-27 10:26:09 +03:00
Marko Mäkelä
0076eb3d4e Merge 10.5 into 10.6 2024-06-24 13:09:47 +03:00
Dave Gosselin
db0c28eff8 MDEV-33746 Supply missing override markings
Find and fix missing virtual override markings.  Updates cmake
maintainer flags to include -Wsuggest-override and
-Winconsistent-missing-override.
2024-06-20 11:32:13 -04:00
Marko Mäkelä
346a0c1402 Merge 10.6 into 10.11 2024-06-17 09:08:07 +03:00
Marko Mäkelä
c849952b71 MDEV-33840: Fix GCC -Wreorder
This fixes up the merge commit 829cb1a49c
2024-06-13 19:57:40 +03:00
Oleksandr Byelkin
dd7d9d7fb1 Merge branch '11.4' into 11.5 2024-05-23 17:01:43 +02:00
Sergei Golubchik
0aae11ac28 Merge branch '10.6' into 10.11 2024-04-30 16:56:49 +02:00