Ok, after some experimenting and code inspection, this is the summary.

This is the logic that decides if mariadb 10.6.7 will try to use uring or not, 
AT RUNTIME:
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] >= '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) */
  }
#endif
  return true;
}


As we can see, it depends on the RUNNING kernel, and details are in 
https://jira.mariadb.org/browse/MDEV-26674

The jammy kernel is 5.15.0, which makes the above return false, meaning
io_uring is NOT used.

The focal kernel is 5.4.0, which makes the above return true, meaning
io_uring IS USED.

That's why running the jammy build of mariadb on a focal kernel attempts
to use io_uring. And this is what the current launchpad builders are:
focal kernel, with chroots for the ubuntu release they are building for.
And mariadbd is run in this env as part of the build-time tests.

Note the above is for RUNTIME decision: HAVE_URING is decided at build
time, and is not related to this bug.

If uring is used, then the memlock limit comes into play: it indeed
needs to be higher. stracing jammy's mariadb on the focal kernel shows
that io_uring_setup() failed with ENOMEM.

Quick reproducer:
- create a focal VM
- confirm ulimit -l value in that VM. I've been getting the value "64", but 
anything lower than 256 will trigger the bug.
- inside that VM, create a jammy LXD
- iside that LXD, install mariadb-server. It will fail.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1970634

Title:
  FTBFS: test failure due to low memlock limit

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/mariadb-10.6/+bug/1970634/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to