[MDEV-24313] Hang with innodb_use_native_aio=0 and innodb_write_io_threads=1 Created: 2020-11-30 Updated: 2021-06-17 Resolved: 2020-12-14 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB |
| Affects Version/s: | 10.5.7, 10.5.8 |
| Fix Version/s: | 10.5.9 |
| Type: | Bug | Priority: | Blocker |
| Reporter: | Marko Mäkelä | Assignee: | Marko Mäkelä |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | hang, regression-10.5 | ||
| Attachments: |
|
||||||||||||||||||||
| Issue Links: |
|
||||||||||||||||||||
| Description |
|
elenst reports that her tests are hanging. The reason seems to be the following combination of parameters:
To add confusion, InnoDB will claim that it is using native AIO (because innodb_use_native_aio=1 by default), but a little later, it will silently change to simulated asynchronous I/O (innodb_use_native_aio=0) due to io_setup() failure. The hang is possible, because starting with
A possible workaround could be to make innodb_write_io_threads=2 the minimum value. Thanks to wlad for participating in the debugging. |
| Comments |
| Comment by Elena Stepanova [ 2020-12-01 ] | |
|
I want to emphasize for posterity: innodb_use_native_aio=0 mentioned in the description is NOT a parameter used by the test. The test runs the server with the default innodb_use_native_aio=1, and all necessary packages are installed on the machines where it is run. Whatever makes InnoDB ignore it happens internally and not configured by the test. This is an important distinction, because stating that it is dependent on innodb_use_native_aio=0 setting would make people discard it as a possible cause of similar problems, since they are not using such an option. It would be wrong – the server can be run with the default innodb_use_native_aio and still be affected. For the other two parameters listed in the description, innodb_doublewrite=1 is the default value; and the test does indeed set innodb_write_io_threads=1. | |
| Comment by Marko Mäkelä [ 2020-12-14 ] | |
|
Before
elenst, I hope that such a message was present in the log. To address this report, I would prefer to avoid touching that logic, but only increase the minimum value of innodb_write_io_threads from 1 to 2. | |
| Comment by Elena Stepanova [ 2020-12-14 ] | |
|
I can't see any such message in the error logs. There was
I don't know if it's related or not. | |
| Comment by Marko Mäkelä [ 2020-12-14 ] | |
|
I now see that if is_linux_native_aio_supported() would return false, the native AIO would be silently disabled. | |
| Comment by Marko Mäkelä [ 2020-12-14 ] | |
|
Also, thread_pool::configure_aio() would silently fall back to simulated AIO. | |
| Comment by Marko Mäkelä [ 2020-12-14 ] | |
|
The minimum value of innodb_write_io_threads will be 2 instead of 1. When we fall back to innodb_use_native_aio=0, we will issue a message about it. The message InnoDB: Using Linux native AIO will no longer be issued before the code has actually been enabled. |