[MDEV-16125] Shutdown crash when innodb_force_recovery >= 2 Created: 2018-05-09 Updated: 2020-07-23 Resolved: 2018-05-09 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB |
| Affects Version/s: | 10.2, 10.3 |
| Fix Version/s: | 10.2.15, 10.3.7 |
| Type: | Bug | Priority: | Major |
| Reporter: | Thirunarayanan Balathandayuthapani | Assignee: | Thirunarayanan Balathandayuthapani |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Description |
|
During shutdown, InnoDB master thread encounters the shutdown state as SRV_SHUTDOWN_FLUSH_PHASE or SRV_SHUTDOWN_LAST_PHASE. But scheduling or waking up of master thread happened after shutdown state is set to SRV_SHUTDOWN_FLUSH_PHASE and it leads to crash in shutdown |
| Comments |
| Comment by Thirunarayanan Balathandayuthapani [ 2018-05-09 ] | ||||||||||||||||||||||||||||||||||||||
|
Test case to repeat the issue:
Add the above diff and execute the following test case:
| ||||||||||||||||||||||||||||||||||||||
| Comment by Thirunarayanan Balathandayuthapani [ 2018-05-09 ] | ||||||||||||||||||||||||||||||||||||||
|
Above patch solves the issue. | ||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2018-05-09 ] | ||||||||||||||||||||||||||||||||||||||
|
I think that we can go for a minimal patch of removing the ut_ad(0) statement that causes the crash in a debug build, and adding a comment. If innodb_force_recovery>=2, the srv_master_thread() is not doing any useful work. So, it could as well exit immediately. In fact, we could avoid creating the thread altogether in this case (in a separate fix). |