One of my MySQL slaves will at one moment, report 57 seconds behind master, and the next will show 0. I am also monitoring with mk-heartbeat which shows an average of less than 1 second. MySQL and system dates are correct. How exactly does MySQL calculate slave lag and what could possibly be causing this reporting error?
To be clear, running show slave status
will report 57 seconds and running show slave status
again (within 1 second) will show 0. This continues flopping indefinitely until the slave thread is restarted. Typically, the server would take at least 10 seconds to recover from a one minute lag.