Percona Server with XtraDB

Unnecessary log_sys->mutex reacquisition in mtr_log_reserve_and_write()

Reported by Alexey Kopytov on 2013-04-02
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MySQL Server
Unknown
Unknown
Percona Server
Status tracked in 5.6
5.1
Undecided
Unassigned
5.5
Medium
Alexey Kopytov
5.6
Medium
Alexey Kopytov

Bug Description

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.

tags: added: xtradb

The exact same reasoning applies to the upstream, but there is no upstream bug ref. Is that intentional?

Hi Laurynas,

On Wed, 03 Apr 2013 06:16:43 -0000, Laurynas Biveinis wrote:
> The exact same reasoning applies to the upstream, but there is no
> upstream bug ref. Is that intentional?
>

Upstream bug ref added.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.