InnoDB change buffer: Unsafe at any speed
The tale of some corruption bugs and how they were found
- Track: MariaDB, MySQL and Friends devroom
- Room: K.3.201
- Day: Sunday
- Start: 11:30
- End: 11:50
- Video only: k3201
- Chat: Join the conversation!
One of the innovations in InnoDB was the change buffer (originally, insert buffer), which aims to convert random I/O to more sequential I/O, by buffering certain changes to secondary index B-tree leaf pages.
Due to its design and nature, any bugs related to the change buffer are extremely hard to reproduce. The change buffer is also becoming irrelevant, as the difference between random and sequential I/O is disappearing along with rotational storage (HDDs).
Thanks to the rr debugger and some improvements to InnoDB data structures, we have been able to reproduce and fix several tricky bugs related to the InnoDB change buffer.
We shortly explain what the InnoDB change buffer is and how it is supposed to work.
We describe the challenges of testing the change buffer and some bug scenarios at a high level.
Focusing on one example, we show how instead of debugging a core dump and guessing what might have led to the problem, we can use rr replay
to analyze a deterministic execution trace from rr record
leading to the failure. We can set breakpoints and data watchpoints and examine the state of the traced process at any point of time of execution. This even works across process boundaries, for crash recovery bugs.
Speakers
Marko Mäkelä |
Attachments
Links
- rr debugger
- MySQL Bug #61104 InnoDB: Failing assertion: page_get_n_recs(page) 1
- MDEV-30009 InnoDB shutdown hangs when the change buffer is corrupted
- MDEV-26917 InnoDB: Clustered record for sec rec not found index
- MDEV-27734 Set innodb_change_buffering=none by default
- MDEV-24449 Corruption of system tablespace or last recovered page
- MDEV-11634 Improve the InnoDB change buffer
- How InnoDB Multi-Version Concurrency Control (MVCC) works
- Video recording (WebM/VP9)
- Video recording (mp4/aac)
- Chat room (web)
- Chat room (app)
- Hallway chat room (web)
- Hallway chat room (app)
- Submit feedback