Bug #69944 Processlist shows Second Behind Master instead of Query time for Replication
Submitted: 7 Aug 2013 6:16 Modified: 6 Mar 2014 13:17
Reporter: Abhijit Buchake Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Replication Severity:S4 (Feature request)
Version:All Versions OS:Any
Assigned to: CPU Architecture:Any
Tags: PROCESSLIST, query time, replication, second behind master

[7 Aug 2013 6:16] Abhijit Buchake
Description:
Hello,
'SHOW [FULL] PROCESSLIST' command returns seconds behind master value for the 'Time' field for the replication thread. This value could be viewed from SHOW SLAVE STATUS command and hence not needed here. Instead, time taken by query would be useful to track long running queries by replication thread on slave.

Sample output:
| Id  | User        | Host      | db           | Command | Time  | State                            | Info
| 422 | system user |           | mydatabase   | Connect | 82321 | Copying to tmp table             | INSERT INTO 

In the above sample output, 82321 seconds was the replication lag while the query hardly took few seconds to complete.

Thanks.

How to repeat:
Execute a long running query on master server and allow it to replicate on slave.
Execute SHOW PROCESSLIST command on the slave server.

Suggested fix:
Display actual time taken by the query for the 'Time' field in processlist for the Replication thread.
[6 Mar 2014 13:17] Arnaud Adant
Hi Abhijit,

Thank you for this reasonable feature request.

Please note that it works as documented :

http://dev.mysql.com/doc/refman/5.6/en/faqs-replication.html#qandaitem-B-13-1-3

I am going to open a documentation bug to document it properly here too :

http://dev.mysql.com/doc/refman/5.6/en/show-processlist.html

Best regards,

Arnaud Adant