I'm trying to figure out why the reporting of slave lag is different in SHOW SLAVE STATUS
and SHOW PROCESSLIST
, in MySQL 5.5.13.
The only difference to other slaves of this master is that it is replicating over a relatively slow connection, about 10Mb/sec (cross site).
SHOW SLAVE STATUS
reports a slave lag of 0, or occasionally, the real slave lag, once every 5-10 requests. (I'm looking at Seconds_Behind_Master
)
SHOW PROCESSLIST
, shows the slave lag under the system_user
's time
column (the one that belongs to the replication sql thread
), like so:
mysql> show processlist \G *************************** 1. row *************************** Id: 1 User: system user Host: db: NULL Command: Connect Time: 63953 State: Waiting for master to send event Info: NULL *************************** 2. row *************************** Id: 2 User: system user Host: db: NULL Command: Connect Time: 61077 State: Slave has read all relay log; waiting for the slave I/O thread to update it Info: NULL
Why would these differ? Or rather, why would SHOW SLAVE STATUS
lie? The monitoring system is looking at this command, and goes crazy due to "spikes" once in a while.
I know for a fact the right number is what SHOW PROCESSLIST
reports, since the slave took a good few days to be initialized, and is catching up slowly.