Skip to content

Commit 6ac340d

Browse files
committed
MDEV-36234: dual stack aio/io_uring on MariaDB-backup
The examination of the AIO method needs to occur after the os_aio_init has been completed.
1 parent 32e5af4 commit 6ac340d

File tree

2 files changed

+24
-10
lines changed

2 files changed

+24
-10
lines changed

extra/mariabackup/xtrabackup.cc

+21-7
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,10 @@ extern const char *innodb_checksum_algorithm_names[];
376376
extern TYPELIB innodb_checksum_algorithm_typelib;
377377
extern const char *innodb_flush_method_names[];
378378
extern TYPELIB innodb_flush_method_typelib;
379+
#ifdef __linux__
380+
extern const char *innodb_linux_aio_names[];
381+
extern TYPELIB innodb_linux_aio_typelib;
382+
#endif
379383

380384
static const char *binlog_info_values[] = {"off", "lockless", "on", "auto",
381385
NullS};
@@ -1114,6 +1118,9 @@ enum options_xtrabackup
11141118
OPT_INNODB_READ_IO_THREADS,
11151119
OPT_INNODB_WRITE_IO_THREADS,
11161120
OPT_INNODB_USE_NATIVE_AIO,
1121+
#ifdef __linux__
1122+
OPT_INNODB_LINUX_AIO,
1123+
#endif
11171124
OPT_INNODB_PAGE_SIZE,
11181125
OPT_INNODB_BUFFER_POOL_FILENAME,
11191126
OPT_INNODB_LOCK_WAIT_TIMEOUT,
@@ -1701,6 +1708,14 @@ struct my_option xb_server_options[] =
17011708
(G_PTR*) &srv_use_native_aio,
17021709
(G_PTR*) &srv_use_native_aio, 0, GET_BOOL, NO_ARG,
17031710
TRUE, 0, 0, 0, 0, 0},
1711+
#ifdef __linux__
1712+
{"innodb_linux_aio", OPT_INNODB_LINUX_AIO,
1713+
"Which linux AIO implementation to use, auto (io_uring, failing to aio) or explicit",
1714+
(G_PTR*) &srv_linux_aio_method,
1715+
(G_PTR*) &srv_linux_aio_method,
1716+
&innodb_linux_aio_typelib, GET_ENUM, REQUIRED_ARG,
1717+
SRV_LINUX_AIO_AUTO, 0, 0, 0, 0, 0},
1718+
#endif
17041719
{"innodb_page_size", OPT_INNODB_PAGE_SIZE,
17051720
"The universal page size of the database.",
17061721
(G_PTR*) &innobase_page_size, (G_PTR*) &innobase_page_size, 0,
@@ -2283,14 +2298,8 @@ static bool innodb_init_param()
22832298

22842299
ut_ad(DATA_MYSQL_BINARY_CHARSET_COLL == my_charset_bin.number);
22852300

2286-
#ifdef _WIN32
2301+
#if defined(_WIN32) || defined(LINUX_NATIVE_AIO) || defined(HAVE_URING)
22872302
srv_use_native_aio = TRUE;
2288-
2289-
#elif defined(LINUX_NATIVE_AIO) || defined(HAVE_URING)
2290-
2291-
if (srv_use_native_aio) {
2292-
msg("InnoDB: Using %s", srv_thread_pool->get_implementation());
2293-
}
22942303
#else
22952304
/* Currently native AIO is supported only on windows and linux
22962305
and that also when the support is compiled in. In all other
@@ -4698,6 +4707,11 @@ static bool xtrabackup_backup_func()
46984707
msg("Error: cannot initialize AIO subsystem");
46994708
goto fail;
47004709
}
4710+
#ifdef __linux__
4711+
if (srv_use_native_aio) {
4712+
msg("InnoDB: Using %s", srv_thread_pool->get_implementation());
4713+
}
4714+
#endif
47014715

47024716
if (!log_sys.create()) {
47034717
msg("Error: cannot initialize log subsystem");

storage/innobase/handler/ha_innodb.cc

+3-3
Original file line numberDiff line numberDiff line change
@@ -315,16 +315,16 @@ static TYPELIB innodb_stats_method_typelib = {
315315

316316
/** Possible values for system variable "innodb_linux_aio" */
317317
#ifdef __linux__
318-
static const char* innodb_linux_aio_names[] = {
318+
const char* innodb_linux_aio_names[] = {
319319
"auto", /* SRV_LINUX_AIO_AUTO */
320320
"io_uring", /* SRV_LINUX_AIO_IO_URING */
321321
"aio", /* SRV_LINUX_AIO_LIBAIO */
322322
NullS
323323
};
324324

325325
/** Used to define an enumerate type of the system variable
326-
innodb_linux_aio. */
327-
static TYPELIB innodb_linux_aio_typelib = {
326+
innodb_linux_aio. Used by mariadb-backup too. */
327+
TYPELIB innodb_linux_aio_typelib = {
328328
array_elements(innodb_linux_aio_names) - 1,
329329
"innodb_linux_aio_typelib",
330330
innodb_linux_aio_names,

0 commit comments

Comments
 (0)