[MDEV-15090] Reduce the overhead of writing undo log records Created: 2018-01-26 Updated: 2021-06-21 Resolved: 2018-01-29 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB |
| Fix Version/s: | 10.3.5 |
| Type: | Task | Priority: | Major |
| Reporter: | Sergey Vojtovich | Assignee: | Marko Mäkelä |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||
| Epic Link: | arm64 optimization | ||||||||||||
| Description |
|
oltp_update_index.lua benchmark commits mini transaction 5 times. This causes log_sys->mutex contention. First two mini transactions (write of the first undo log record and the creation of the undo log header) can be combined. This change was verified to give ~10% better throughput. |
| Comments |
| Comment by Marko Mäkelä [ 2018-01-29 ] |
|
I had some doubts whether this is safe to do in all cases or if some deadlocks could be caused due to making changes to some pages after a page allocation. (There is a rule about that in operations that affect the change buffer; see the comment in the function btr_compress() which BTW is involved in the deadlock that has been reported in It turns out that whenever there is not enough space for the undo log record in the undo log page, InnoDB will commit the mini-transaction and start a new one. It also turns out that the undo log record write would be attempted on the same page that was already written to within trx_undo_assign_undo(). So, merging the mini-transactions should be completely safe. |