Bug #84989 Add more replication counters
Submitted: 14 Feb 2017 11:17 Modified: 30 Mar 2017 6:26
Reporter: Simon Mudd (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Replication Severity:S4 (Feature request)
Version:5.7+ OS:Any
Assigned to: CPU Architecture:Any
Tags: counters, missing_counters, performance_schema, replication

[14 Feb 2017 11:17] Simon Mudd
Description:
Related to bug#54250 there are other counters which are not provided by MySQL but which can be helpful for diagnosis of issues in a replicated environment.

How to repeat:
See above.

Suggested fix:
The following counters or performance_schema "metrics" would be useful:

* executed_unsafe_statements
* skipped_statements (using sql_slave_skip_counter)
* skipped_rows (using sql_slave_skip_counter, but only applicable if you know the rows affected. I'd guess in RBR mode this is known.  If heavy to compute etc this may not be worthwhile.  If easy to compute also split by INSERTS/UPDATE/DELETES/DDL)
* i/o thread connects and disconnects (disconnects both triggered by "stop slave io_thread" but also by the connection dropping, if possible by reason)

Most of these metrics indicate _potential_ lost data and give some indication of the amount of lost data. In the case of the i/o thread [re]connects logging is still incomplete (I have another FR open to fix that) but unexpected disconnects are an indication of a problem and if frequent this is often something that needs investigation.
[30 Mar 2017 6:26] MySQL Verification Team
Hello Simon,

Thank you for the report and reasonable feature request!

Thanks,
Umesh