SHOW SLAVE STATUS¶
STOP SLAVE and
SHOW SLAVE STATUS commands can conflict due to a global lock in the situation where one thread on a slave attempts to execute a
STOP SLAVE command, while a second thread on the slave is already running a command that takes a long time to execute.
STOP SLAVE command is given in this situation, it will wait and not complete execution until the long-executing thread has completed its task. If another thread now executes a
SHOW SLAVE STATUS command while the STOP SLAVE command is waiting to complete, the
SHOW SLAVE STATUS command will not be able to execute while the
STOP SLAVE command is waiting.
This features modifies the
SHOW SLAVE STATUS syntax to allow:
SHOW SLAVE STATUS NONBLOCKING
This will display the slave’s status as if there were no lock, allowing the user to detect and understand the situation that is occurring.
The information given when
NONBLOCKING is used may be slightly inconsistent with the actual situation while the lock is being held.
Percona Server for MySQL originally used
SHOW SLAVE STATUS NOLOCK syntax for this feature. As of
5.6.20-68.0 release, Percona Server for MySQL implements
SHOW SLAVE STATUS NONBLOCKING syntax, which comes from early MySQL 5.7. Current MySQL 5.7 does not have this syntax and regular
SHOW SLAVE STATUS is non-blocking.
Variable Type: Numeric Scope: Global/Session
Com_show_slave_status_nolock statement counter variable indicates the number of times the statement
SHOW SLAVE STATUS NOLOCK has been executed.
Version Specific Information¶
5.6.11-60.3: Feature ported from Percona Server for MySQL 5.5.
5.6.20-68.0: Percona Server for MySQL implemented the
NONBLOCKINGsyntax from MySQL 5.7 and deprecated the
SHOW SLAVE STATUS NOLOCKsyntax in 5.6 has been undeprecated. Both
SHOW SLAVE STATUS NOLOCKand
SHOW SLAVE STATUS NONBLOCKINGare now supported.