MariaDB 10.6 SUX locks for improved performance
summary
MariaDB 10.6 replaces fragile home‑brew sync primitives with OS mutexes and condition variables, implements futex-based reader-writer locks for compact page/index latches, and adds recursion, ownership passing and an update (U) latch mode that allows concurrent readers with upgrade/downgrade. Small embedded locks (including 4-byte embedded mutexes) cut buf_block_t size ~50% and improve cache locality. lock_sys moves from a global mutex to a shared latch plus per-hash latches and optimistic commit cleanup; microbenchmarks show modest gains up to ~40 connections, with workarounds needed for purge and further tuning planned.
AI-written summary · about
chapters (17)
- 0:00Intro
- 0:25Locks and Latches
- 2:09Some Low-Level Synchronization Primitives
- 3:51InnoDB Specific Synchronization Primitives
- 6:17Special Requirements of Page Latches
- 9:37Reinventing the Mutex where Needed
- 11:44Reinventing the Read/Write Locks
- 13:30Reinventing the Index and Page Latches
- 15:29Some Benefits of the Latch Refactoring
- 19:08Transactional Locks in InnoDB
- 21:47How we Improved lock_sys Scalability
- 27:10InnoDB record locking: Manipulating Locks
- 28:05InnoDB record locking: Moving Locks
- 28:44InnoDB record locking: Exclusive latch
- 30:05InnoDB record locking: Transaction Commit
- 32:58Was it Worth It?
- 36:21Remaining Scalability Bottlenecks
