0

I'm trying to use Exec_Master_Log_Pos from SHOW REPLICA STATUS to check whether the replica is caught up to the master. However, Exec_Master_Log_Pos appears to take a while to update.

When I add a row to the master, I can correctly query the row in the replica within 30 ms. In addition, the Read_Master_Log_Pos from SHOW REPLICA STATUS also updates to the correct value within 30 ms.

So the data in the replica is updated within 30 ms, but I have to wait ~300 ms for Exec_Master_Log_Pos to update to the right value.

A few questions come to mind:

  • Why is Exec_Master_Log_Pos so slow to update?
  • Should I be using another method to check whether my replica has caught up to a specific timestamp on the master? Perhaps I should just write a value to the master and read it in a loop on the replica instead of relying on SHOW REPLICA STATUS?

I am spinning up MySQL 8.0 master and replica with docker-compose.yml and following these directions to set up the MySQL replica

4
  • Are any heavy queries been executing on the replica ? Commented May 25 at 10:26
  • No, it is idle. I did notice the time to Exec log update get even worse when heavy queries are being executed on the master.
    – Victor L
    Commented May 26 at 2:28
  • It seems that the slave needs more time to process the data. Master/Slave servers do they have the same parameters and configurations? Commented May 26 at 10:00
  • Basic vanilla config for both of them from the Docker image. The issue is that if I read the data from the replica, I get the correct (replicated) data. But the Exec_Master_Log_Pos value doesn't update to the expected value for a while longer.
    – Victor L
    Commented May 28 at 1:18

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.