Bug #69940 Please record relay_log_file and position when replication errors occur.
Submitted: 6 Aug 2013 14:58 Modified: 2 May 2014 5:17
Reporter: Simon Mudd (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Replication Severity:S4 (Feature request)
Version:5.7.1 OS:Any
Assigned to: CPU Architecture:Any

[6 Aug 2013 14:58] Simon Mudd
Description:

When an RBR error occurs you get an error but this mentions the failed event on the master server, not the local relay log file where the error actually occurred:

2013-08-06 12:09:46 10404 [ERROR] Slave SQL: Could not execute Delete_rows_v1 event on table my_db.my_table; Can't find record in 'my_table', Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event's master log binlog.005037, end_log_pos 495379, Error_code: 1032

So if I want to look at the event causing the problem I need to look on the master when the actual data should also be on the slave in the relay log file.

How to repeat:
break replication and look for the error message which tells you were the problem is on the master's binlog.

Suggested fix:
Suggested alternative format:

013-08-06 12:09:46 10404 [ERROR] Slave SQL: Could not execute Delete_rows_v1 event on table my_db.my_table; Can't find record in 'my_table', Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event's master log binlog.005037, end_log_pos 495379, relay log file relaylog.001234, end_log_pos 12345, Error_code: 1032
[6 Aug 2013 14:59] Simon Mudd
By providing the relay log file and position you can immediately look on the slave at the event with mysqlbinlog. This saves having to log on to another server.
[6 Aug 2013 15:29] MySQL Verification Team
related: http://bugs.mysql.com/bug.php?id=35667