Bug #102295 Improve error message when MTS breaks.
Submitted: 19 Jan 2021 10:58 Modified: 19 Jan 2021 12:42
Reporter: Simon Mudd (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Row Based Replication ( RBR ) Severity:S4 (Feature request)
Version:8.0.21 OS:Any
Assigned to: CPU Architecture:Any
Tags: error_reporting, MTS, replication

[19 Jan 2021 10:58] Simon Mudd
Description:
I see this error from time to time on my systems:

Last SQL Error     Coordinator stopped because there were error(s) in the worker(s). The most recent failure being: Worker 1 failed executing transaction '978abccb-52e1-11eb-9ce8-525400394120:971374' at master log binlog.000009, end_log_pos 36652449. See error log and/or performance_schema.replication_applier_status_by_worker table for more details about this failure or others, if any.

This is useless as it forces me to look up the error message somewhere else.
It's also useless as it does not give me a query I can run to find the error as I have to filter out "working / idle" threads.

How to repeat:
Sun show slave status on a server with a MTS setup where one of the threads is broken.

Suggested fix:
Provide a better query to use to get the actual error:

e.g. select * from performance_schema.replication_applier_status_by_worker where last_error_number <> 0

This allows me to see the specific error(s) which "stop/break" replication.

Better still would be to provide the actual error as part of SHOW SLAVE STATUS rather than forcing me to look it up.

e.g. in the specific case I saw this the error was similar to:

Worker 1 failed executing transaction '978abccb-52e1-11eb-9ce8-525400394120:971374' at master log binlog.000009, end_log_pos 36652449; Error 'There is no such grant defined for user 'some_user' on host '127.0.0.1'' on query. Default database: ''. Query: 'REVOKE <removed> FROM 'some_user'@'127.0.0.1'
[19 Jan 2021 12:42] MySQL Verification Team
Hello Simon,

Thank you for the report and feedback.
verifying as a reasonable feature request!

regards,
Umesh