Log tracking should not acquire log mutex for log reading

Bug #1171699 reported by Laurynas Biveinis
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Server moved to https://jira.percona.com/projects/PS
Fix Released
Medium
Laurynas Biveinis
5.1
Fix Released
Medium
Laurynas Biveinis
5.5
Fix Released
Medium
Laurynas Biveinis
5.6
Fix Released
Medium
Laurynas Biveinis

Bug Description

The log tracker thread reads the log in log block size chunks by doing

 mutex_enter(&log_sys->mutex);
 log_group_read_log_seg(LOG_RECOVER, log_bmp_sys->read_buf,
          group, block_start_lsn, block_end_lsn);
 mutex_exit(&log_sys->mutex);

This code allows reusing log_group_read_log_seg(), which requires that log_sys mutex is being held, without any changes, but there is no reason to hold the mutex for the I/O itself.

Tags: bitmap xtradb

Related branches

tags: added: xtradb
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

A preliminary fix that does not hold the mutex during the log read fixes a performance regression of some 30% on a Sysbench write-only workload and makes its performance ~match the case of log tracking disabled.

This fix still acquires the mutex for the log_group_calc_lsn_offset() call, which does not seem necessary neither, but removing that seems to be 1) more involved; 2) not that urgent now.

tags: added: bitmap
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-1356

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

Other bug subscribers

Remote bug watches

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