Observability of MySQL 8 Replication Using Performance Schema and Sys Schema Views
The article explains how MySQL 8 enhances replication observability by exposing detailed metrics through Performance Schema tables and sys schema views, providing DBAs with richer information such as per‑channel lag, worker thread states, and full replication status beyond the traditional SHOW REPLICA STATUS output.
Experienced MySQL DBAs often use SHOW REPLICA STATUS and the Seconds_Behind_Source column to monitor asynchronous replication, but MySQL 8 provides richer observability through the Performance Schema and sys schema views.
The Performance_Schema now contains 15 tables that expose detailed replication metrics, such as applier configuration, filters, status, group communication, and more. Understanding these metrics can be challenging, so the article introduces a set of sys schema views that present the data in a more accessible form.
View sys.replication_lag shows per‑channel maximum lag from the original source and the immediate source, revealing that the example instance is an asynchronous replica that is also part of an InnoDB ClusterSet DR cluster, with a lag of about 5 seconds.
View sys.replication_status provides a row per worker thread, displaying IO, coordinator, and worker states (all ON) as well as lag information, which is not visible in the traditional SHOW REPLICA STATUS output.
For full detail, sys.replication_status_full returns extensive fields such as channel, host, IO/CO/W states, error codes, timestamps, transport time, apply time, and GTID sets, allowing deep analysis of replication health.
In InnoDB Cluster environments, the MySQL Shell status() command can retrieve the same information programmatically, with extended option 3 exposing per‑member replication statistics, including applier and coordinator thread states, lag, and transaction sets.
The article concludes that MySQL 8’s observability features give DBAs far more insight into replication, and it may be time to adopt these new views and tools for monitoring.
Aikesheng Open Source Community
The Aikesheng Open Source Community provides stable, enterprise‑grade MySQL open‑source tools and services, releases a premium open‑source component each year (1024), and continuously operates and maintains them.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.