{question}
How do I tell if there is replication lag in my replica database (DR)?
{question}
{answer}
Replication lag is the difference between the primary and replica database that is yet to be replicated to the replica database. In most cases, the difference is zero and there is no lag as the replicating database is kept in sync with the primary database.
However, if you want to check or confirm this, you can use the SHOW REPLICATION STATUS; command executed on the Master Aggregator node to show the status of every replication process running, including Master and Slave URI's and byte positions of the replicating partitions.
SingleStoreDB also offers several internal tables where you can monitor replication with more granularity and insight. These tables are:
mv_aggregated_replication_status
By querying these tables, you can view the progress of replications between the primary and the secondary cluster and can tell whether the replication is caught up on the secondary cluster by checking the values of the LSN_LAG
or ESTIMATED_CATCHUP_TIME_S
columns.
See our documentation here to find more about monitoring replication and more details on data represented by the replication status tables.
{answer}