Details
-
Task
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
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.
Attachments
Issue Links
- causes
-
MDEV-22770 trx_undo_report_rename() fails to release page latches
-
- Closed
-
-
MDEV-25979 Invalid undo page number written to DB_ROLL_PTR
-
- Closed
-
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
MDEV-14637.)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.