Bug #76024 More concurrency in SHOW SLAVE STATUS: make LOCK_msr_map an rwlock
Submitted: 24 Feb 2015 13:31 Modified: 8 Oct 2015 13:35
Reporter: Sven Sandberg Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Replication Severity:S2 (Serious)
Version:5.7 OS:Any
Assigned to: CPU Architecture:Any

[24 Feb 2015 13:31] Sven Sandberg
Description:
In 5.7.0, we added the command SHOW SLAVE STATUS NONBLOCKING (WL#6402). This suppressed taking LOCK_active_mi for SHOW SLAVE STATUS, which gave better concurrency, but some of the fields displayed by SHOW SLAVE STATUS could be inconsistent. The primary motivation was to allow SHOW SLAVE STATUS to execute when a STOP SLAVE statement is holding the lock.

In 5.7.5, we had to remove the NONBLOCKING feature because it was not possible to suppress the lock, because the locking scheme changed in multi-source (WL#1697). So this was a regression, as the feature was removed.

How to repeat:
read the code

Suggested fix:
We can make SHOW SLAVE STATUS nonblocking *and* keep the fields displayed by SHOW SLAVE STATUS consistent.
The solution is to change LOCK_msr_map into a read-write lock. The wrlock should be taken when modifying msr_map, the rdlock when accessing it.

We should still not allow the NONBLOCKING keyword.
[8 Oct 2015 13:35] David Moss
The following was added to the 5.7.9 changelog:

The locking behavior of replication administration statements has changed to make SHOW SLAVE STATUS more concurrent. This makes the NONBLOCKING clause redundant for SHOW SLAVE STATUS and it has been removed.