summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2021-11-23 14:38:05 +0200
committerDaniel Black <daniel@mariadb.org>2021-11-25 09:38:58 +1100
commitde7db5517de11a58d57d2a41d0bc6f38b6f92dd8 (patch)
treebb444463d48414fc68804cbe59418007cf56ba09
parentfcc8f480af2511fb1c726cad94578afbdf8a5617 (diff)
downloadmariadb-git-bb-10.6-MDEV-26674.tar.gz
MDEV-26674 follow-up: Bless Linux 5.15.3bb-10.6-MDEV-26674
In commit 1193a793c40b806c6f1f007bbd87f4d9a73e686d we set innodb_use_native_aio=OFF when using io_uring on a kernel where write requests could potentially be lost. The last reproducible issue was fixed in Linux 5.16-rc1 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v5.16-rc1&id=d3e3c102d107bb84251455a298cf475f24bab995 and the fix was backported to 5.15.3. Hence, using a 5.16 or later kernel should be fine. The Debian kernel 5.15.0-1-amd64 (5.15.3-1) was tested. On Debian, utsname::release or uname -r does not reflect the exact minor version while utsname::version and uname -v does. On Fedora however the utsname::version is rather different: $ uname -r 5.14.20-200.fc34.x86_64 $ uname -v #1 SMP Thu Nov 18 22:03:20 UTC 2021 As such we use the version, but fall back to the release if there isn't the beginnings of a kernel version in the version. Thanks to Daniel Black for reporting the Linux kernel bug and Jens Axboe for actually fixing it. Co-Authored-By: Daniel Black <daniel@mariadb.org> Closes: #1953
-rw-r--r--storage/innobase/handler/ha_innodb.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 73d52e19bf1..a0781873183 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -19396,8 +19396,15 @@ bool innodb_use_native_aio_default()
#ifdef HAVE_URING
utsname &u= uname_for_io_uring;
if (!uname(&u) && u.release[0] == '5' && u.release[1] == '.' &&
- u.release[2] == '1' && u.release[3] > '0' && u.release[3] < '6')
+ u.release[2] == '1' && u.release[3] >= '1' && u.release[3] <= '5' &&
+ u.release[4] == '.')
{
+ if (u.release[3] == '5') {
+ const char *s= strstr(u.version, "5.15.");
+ if (s || (s= strstr(u.release, "5.15.")))
+ if ((s[5] >= '3' || s[6] >= '0'))
+ return true; /* 5.15.3 and later should be fine */
+ }
io_uring_may_be_unsafe= u.release;
return false; /* working around io_uring hangs (MDEV-26674) */
}