Bug #78705 Improve Client Error For Certification Failures
Submitted: 5 Oct 2015 14:59 Modified: 1 Apr 2016 11:08
Reporter: Matthew Lord Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Group Replication Severity:S4 (Feature request)
Version:5.7 OS:Any
Assigned to: CPU Architecture:Any
Tags: gcs, gr

[5 Oct 2015 14:59] Matthew Lord
Description:
When a write certification fails and thus the local commit fails, this is the error sent back to the client:
Error: 1181 SQLSTATE: HY000 (ER_ERROR_DURING_ROLLBACK)
Message: Got error 149 during ROLLBACK

MySQL error code 149 being "Lock deadlock; Retry transaction".

It's confusing to get a rollback error on commit, for two reasons:
1. The user action was commit
2. The rollback actually succeeds

How to repeat:
N/A

Suggested fix:
We should try and improve this. For example, perhaps we could instead use:
Error: 1180 SQLSTATE: HY000 (ER_ERROR_DURING_COMMIT)
Message: Got error 149 during COMMIT

Hopefully we can be even more descriptive then that. Perhaps new error codes and messages specific to this context and scenario.
[6 Oct 2015 16:38] Andrei Elkin
To clarify a bit,
the error actually can happen not only when the local trx commits, but rather
at its next query that happens after a certified trx has committed to victimize the local one.

As a hint to compose a sensible error text, consider that
the error is essentially a sort of snapshot isolation failure
which can take place in few database implementations that implemented
this feature (without any cluster).

Some go with
"ERROR:  could not serialize access due to concurrent update", some others with
"Snapshot isolation transaction aborted due to update conflict”.
[1 Apr 2016 11:08] Nuno Carvalho
Posted by developer:
 
After BUG#23021168: REPLICATION STOPS AFTER TRANSACTION IS ROLLED BACK ASYNCHRONOUSLY IN MASTER fix, the error ER_ERROR_DURING_ROLLBACK is not thrown anymore.