[MDEV-11695] Define a reasonable upper limit for innodb_spin_wait_delay Created: 2016-12-30 Updated: 2017-01-07 Resolved: 2017-01-03 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB |
| Affects Version/s: | 10.2 |
| Fix Version/s: | 10.2.4 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Elena Stepanova | Assignee: | Marko Mäkelä |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
|
To reproduce:
It takes a while (~1.5 min on my machine), but eventually it fails with
Not reproducible on 10.0, 10.1, MySQL 5.6, MySQL 5.7.
|
| Comments |
| Comment by Marko Mäkelä [ 2017-01-03 ] |
|
For me, it already hangs at startup in SysTablespace::open_or_create() on mutex_enter(&fil_system->mutex), conflicting with fil_validate() from an io_handler_thread. |
| Comment by Marko Mäkelä [ 2017-01-03 ] |
|
I cannot repeat the hang as described, but it could be a timing issue. I think that we only need a conflict on some mutex (fil_system->mutex is a good candidate), and then the insanely long ut_delay() will trip the 100-second timeout in srv_shutdown_all_bg_threads(). |
| Comment by Marko Mäkelä [ 2017-01-03 ] |
|
There is no upper limit for innodb_spin_wait_delay in MySQL either (other than ~0UL which is practically infinite on systems with 64-bit long). Given that ut_delay() is documented to be an approximate delay in microseconds on a 100MHz Intel Pentium processor and given that innodb_spin_wait_delay is the maximum value for the argument passed to ut_delay(), I think that the upper limit should be some thousands. The default value is 6. Even though today’s processors are faster than an Intel Pentium running at 100MHz, it does not make sense to busy-wait without polling the condition even for a millisecond. |
| Comment by Jan Lindström (Inactive) [ 2017-01-03 ] |
|
ok to push. |