-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
MDEV-36234: Dual stack libaio/liburing #3976
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 10.6
Are you sure you want to change the base?
Conversation
FIXME: Introduce a parameter for explicitly specifying which one to use: innodb_linux_aio=libaio/liburing/auto FIXME: In srv_start(), indicate which implementation was chosen
|
Debian packaging is no longer aio exclusive or uring, so for those older versions, its a remove_uring directive. Add manditory liburing for consistent packaging, if workers need to be updated that can be handled. WITH_LIBAIO is now an independent option from WITH_URING.
b1e9ea3
to
5157b6e
Compare
Add abstraction to return implementation name from threadpool.
Remove version check on the kernel as it now corresponds to a working RHEL9 kernel and the problem was only there in pre-release kernels that shouldn't have been used in production. This reverts commit 3dc0d88.
...when using io_uring on a potentially affected kernel" Remove version check on the kernel as it now corresponds to a working RHEL9 kernel and the problem was only there in pre-release kernels that shouldn't have been used in production. This reverts commit 1193a79.
Noted in MDEV-36542 that it wasn't used and the compile warning -Wunused-private-field is legitimate. Review: Vladislav Vaintroub
As noted by Jens Axobe, errno isn't set, it is returned by the io_uring_queue_init function.
This controls which linux implementation to use under the assumption that innodb_native_aio is true. "auto" select liburing first, if fails, tries libaio with a filesystem test, and if fails, falls back to no-async. "aio" starts is per auto, but skips liburing step.
The examination of the AIO method needs to occur after the os_aio_init has been completed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed Windows compilation. Other than that, and minor commit on unnecessary attribute(unused), I do not have any objections
#ifdef HAVE_URING | ||
aio *create_libaio(thread_pool *pool, int max_io) | ||
#else | ||
aio *create_linux_aio(thread_pool *pool, int max_io, aio_implementation implementation __attribute__((unused))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drop the implementation __attribute__((unused))
from this line. Just aio_implementation
. It's cleaner
It is C++, if you do not have to name parameter, if you do not use them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 14 out of 21 changed files in this pull request and generated 2 comments.
Files not reviewed (7)
- debian/autobake-deb.sh: Language not supported
- debian/rules: Language not supported
- mysql-test/mariadb-test-run.pl: Language not supported
- mysql-test/suite/sys_vars/r/innodb_linux_aio_basic.result: Language not supported
- mysql-test/suite/sys_vars/t/innodb_linux_aio_basic.test: Language not supported
- mysql-test/suite/sys_vars/t/sysvars_innodb.test: Language not supported
- tpool/CMakeLists.txt: Language not supported
Comments suppressed due to low confidence (3)
tpool/tpool_generic.cc:220
- Please verify that the removal of m_group_enqueued is intentional; if it was tracking any necessary metrics, ensure these metrics are either no longer needed or are correctly handled elsewhere.
unsigned long long m_group_enqueued;
storage/innobase/handler/ha_innodb.cc:19516
- There is a spelling mistake in the documentation: 'implementaiton' should be corrected to 'implementation'.
Specifies which InnoDB AIO implementaiton should used. Possible value are "auto" ...
tpool/aio_linux.cc:120
- [nitpick] Double-check that using reinterpret_cast here is safe and that event.obj is always of type aiocb*. This cast assumes a specific memory layout; consider adding a static_assert or runtime check if feasible.
aiocb *iocb= reinterpret_cast<aiocb*>(event.obj);
@@ -300,12 +299,12 @@ class thread_pool_generic : public thread_pool | |||
void wait_begin() override; | |||
void wait_end() override; | |||
void submit_task(task *task) override; | |||
aio *create_native_aio(int max_io) override | |||
aio *create_native_aio(int max_io, aio_implementation implementation) override | |||
{ | |||
#ifdef _WIN32 | |||
return create_win_aio(this, max_io); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure that all callers of create_native_aio have been updated to pass the appropriate aio_implementation argument, to maintain consistency with the new function signature.
return create_win_aio(this, max_io); | |
return create_win_aio(this, max_io, implementation); |
Copilot uses AI. Check for mistakes.
max_events, | ||
tpool::OS_AIO); | ||
if (!ret && !is_linux_native_aio_supported()) | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Clarify the fallback behavior when native AIO is unsupported. An inline comment explaining why ret is set to 1 in this case would improve maintainability.
{ | |
{ | |
int // Fallback: Set ret to 1 to indicate that native AIO is unsupported, | |
// and we should proceed with non-native AIO methods. |
Copilot uses AI. Check for mistakes.
srv_use_native_aio= false; | ||
ret= srv_thread_pool->configure_aio(false, max_events); | ||
} | ||
switch (srv_linux_aio_method) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion : I think most of this if linux
fallback logic (uring to libaio) could be handled inside tpool::configure_aio itself, you got the OS_DEFAULT for it, right? Will be less clutter here and you can put OS_DEFAULT to use
Description
FIXME: Introduce a parameter for explicitly specifying which one to use: innodb_linux_aio=libaio/liburing/auto
FIXME: In
srv_start()
, indicate which implementation was chosenRelease Notes
TBD
How can this PR be tested?
TBD
Basing the PR against the correct MariaDB version
main
branch.We may want to base this on 10.11 instead of 10.6, if there is no
liburing
capable GNU/Linux distribution that would by default ship 10.6.PR quality check