Affects Version/s: None
Fix Version/s: None
**Reported in Launchpad by Alexey Kopytov last update 04-04-2013 03:50:23
mtr_log_reserve_and_write() implements the following logic with respect
to log_sys->mutex: if the mini-transaction log contains a single block,
it calls log_reserve_and_write_fast() which acquires log_sys->mutex and
does a "fast" write by appending the new record to the current log
block. If the record does not fit in the current log block,
log_reserve_and_write_fast() releases log_sys->mutex and returns 0, in
which case mtr_log_reserve_and_write() immediately reacquires
log_sys->mutex by calling log_reserve_and_open() and proceeds with the
"slow" write procedure.
It doesn't make sense to release a mutex and reacquire it immediately
and benchmarks show that avoiding this helps to reduce log_sys->mutex
contention in some write-intensive workloads.