Uploaded image for project: 'Percona Server for MySQL'
  1. Percona Server for MySQL
  2. PS-1347

LP #1163439: Unnecessary log_sys->mutex reacquisition in mtr_log_reserve_and_write()

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None

      Description

      **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.

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            lpjirasync lpjirasync (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Smart Checklist