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