Bug #72977 Taking write lock while adding a GTID into gtid set is not good to performance
Submitted: 12 Jun 2014 6:01 Modified: 8 Jul 2014 13:36
Reporter: Bill Qu Email Updates:
Status: Closed Impact on me:
None 
Category:Tests: Replication Severity:S3 (Non-critical)
Version:5.7 OS:Any
Assigned to: CPU Architecture:Any

[12 Jun 2014 6:01] Bill Qu
Description:
In Gtid_state::update_on_commit(), it takes global_sid_lock.wrlock() while adding a GTID
into gtid set, which is not good to performance.

How to repeat:
Read code.

Suggested fix:
Optimize it to take global_sid_lock.rdlock() and lock a mutex for the given SIDNO
while adding the GTID into gtid set for improving performance.
[8 Jul 2014 13:36] Jon Stephens
Thank you for your bug report. This issue has been committed to our source repository of that product and will be incorporated into the next release.

Documented fix in the 5.7.5 changelog as follows:

    Removed an unnecessary write lock that was taken by an internal
    function while adding a GTID to a GTID set, which should improve
    the performance of the function and the code dependent on it
    during such operations.

Closed.

If necessary, you can access the source repository and build the latest available version, including the bug fix. More information about accessing the source trees is available at

    http://dev.mysql.com/doc/en/installing-source.html