[MDEV-23380] InnoDB reads a page from disk despite parsing MLOG_INIT_FILE_PAGE2 record Created: 2020-08-03 Updated: 2020-10-06 Resolved: 2020-08-18 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB |
| Affects Version/s: | 10.2.32, 10.3.23, 10.4.13 |
| Fix Version/s: | 10.2.35, 10.3.26, 10.4.16 |
| Type: | Bug | Priority: | Major |
| Reporter: | Thirunarayanan Balathandayuthapani | Assignee: | Thirunarayanan Balathandayuthapani |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | not-10.5, rr-profile-analyzed | ||
| Issue Links: |
|
||||||||||||||||||||||||
| Description |
|
During recovery, InnoDB tries to fetch the page from disk even though The following stack trace tries to fetch the page even it has
It leads to infinite loop of buf_page_create() and recv_recovery_create_page_low() |
| Comments |
| Comment by Marko Mäkelä [ 2020-08-03 ] | |||||||||||||||||||||||||||||||||||||||
|
thiru, thank you for the analysis. I think that the stack trace clearly demonstrates the problem. The immediate problem appears to have been solved in the 10.5 release, mostly by On a related note, are we already disabling both the linear and the random read-ahead during recovery? That is, let recovery only read pages via recv_read_in_area()? In Of course, disabling the background read-ahead will not address the problem that is demonstrated by the stack trace, because that read request occurs in the foreground, by btr_cur_prefetch_siblings(). Maybe we should extend buf_read_page_background() with similar checks as those that were to buf_page_get_gen() in Note: even though 10.5 might not be affected by this problem, future major versions could be, after we implement | |||||||||||||||||||||||||||||||||||||||
| Comment by Thirunarayanan Balathandayuthapani [ 2020-08-03 ] | |||||||||||||||||||||||||||||||||||||||
|
buf_read_ahead_random(), buf_read_ahead_linear() has the following check:
srv_startup_is_before_trx_rollback_phase is being set to FALSE after applying redo logs. | |||||||||||||||||||||||||||||||||||||||
| Comment by Thirunarayanan Balathandayuthapani [ 2020-08-03 ] | |||||||||||||||||||||||||||||||||||||||
|
The following patch solves the issue:
| |||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2020-08-03 ] | |||||||||||||||||||||||||||||||||||||||
|
thiru, thank you, that patch looks like it should be safe. A possibly better fix might be to avoid invoking btr_cur_prefetch_siblings() for the change buffer tree. The SX-locking rules should not really apply to that tree, and operations on the non-leaf pages of the change buffer should be covered by ibuf_pessimistic_insert_mutex(). Here is an untested patch for 10.4:
| |||||||||||||||||||||||||||||||||||||||
| Comment by Thirunarayanan Balathandayuthapani [ 2020-08-04 ] | |||||||||||||||||||||||||||||||||||||||
|
Patch is in bb-10.2- | |||||||||||||||||||||||||||||||||||||||
| Comment by Matthias Leich [ 2020-08-13 ] | |||||||||||||||||||||||||||||||||||||||
|
The tree commit 935415a9cdecf87a66166921e3f7594bf80fce77 (HEAD, origin/bb-10.2-thiru) |